2010-11-01 17:03:46 +01:00
|
|
|
/**************************************************************************
|
|
|
|
**
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
**
|
2011-01-11 16:28:15 +01:00
|
|
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
2010-11-01 17:03:46 +01:00
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Contact: Nokia Corporation (info@qt.nokia.com)
|
2010-11-01 17:03:46 +01:00
|
|
|
**
|
|
|
|
**
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2010-11-01 17:03:46 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
**
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-07-05 18:26:01 +02:00
|
|
|
** Nokia at info@qt.nokia.com.
|
2010-11-01 17:03:46 +01:00
|
|
|
**
|
|
|
|
**************************************************************************/
|
|
|
|
|
2010-07-08 14:00:33 +02:00
|
|
|
#ifndef QMLTOOLBAR_H
|
|
|
|
#define QMLTOOLBAR_H
|
|
|
|
|
2011-01-24 12:30:21 +01:00
|
|
|
#include <QtGui/QToolBar>
|
|
|
|
#include <QtGui/QIcon>
|
|
|
|
|
2011-05-30 16:32:25 +02:00
|
|
|
#include "qmlinspectorconstants.h"
|
2010-07-08 14:00:33 +02:00
|
|
|
|
2011-03-16 19:59:49 +01:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QActionGroup)
|
|
|
|
|
2010-09-22 09:59:18 +02:00
|
|
|
namespace QmlJSDebugger {
|
2010-07-08 14:00:33 +02:00
|
|
|
|
|
|
|
class ToolBarColorBox;
|
|
|
|
|
2011-02-22 14:23:57 +01:00
|
|
|
class QmlToolBar : public QToolBar
|
2010-07-08 14:00:33 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2011-02-22 14:23:57 +01:00
|
|
|
explicit QmlToolBar(QWidget *parent = 0);
|
|
|
|
~QmlToolBar();
|
2010-07-08 14:00:33 +02:00
|
|
|
|
|
|
|
public slots:
|
2010-07-12 12:02:35 +02:00
|
|
|
void setDesignModeBehavior(bool inDesignMode);
|
2010-07-08 14:00:33 +02:00
|
|
|
void setColorBoxColor(const QColor &color);
|
|
|
|
void activateColorPicker();
|
|
|
|
void activateSelectTool();
|
|
|
|
void activateMarqueeSelectTool();
|
|
|
|
void activateZoom();
|
2011-03-16 19:59:49 +01:00
|
|
|
|
|
|
|
void setAnimationSpeed(qreal slowDownFactor);
|
2011-03-22 10:37:14 +01:00
|
|
|
void setAnimationPaused(bool paused);
|
2010-07-08 14:00:33 +02:00
|
|
|
|
|
|
|
signals:
|
2011-03-16 19:59:49 +01:00
|
|
|
void animationSpeedChanged(qreal factor);
|
2011-03-22 10:37:14 +01:00
|
|
|
void animationPausedChanged(bool paused);
|
2010-07-08 14:00:33 +02:00
|
|
|
|
2010-07-12 12:02:35 +02:00
|
|
|
void designModeBehaviorChanged(bool inDesignMode);
|
2010-07-08 14:00:33 +02:00
|
|
|
void colorPickerSelected();
|
|
|
|
void selectToolSelected();
|
|
|
|
void marqueeSelectToolSelected();
|
|
|
|
void zoomToolSelected();
|
|
|
|
|
|
|
|
void applyChangesToQmlFileSelected();
|
|
|
|
void applyChangesFromQmlFileSelected();
|
|
|
|
|
|
|
|
private slots:
|
2010-07-12 12:02:35 +02:00
|
|
|
void setDesignModeBehaviorOnClick(bool inDesignMode);
|
2010-07-08 14:00:33 +02:00
|
|
|
void activatePlayOnClick();
|
|
|
|
void activateColorPickerOnClick();
|
|
|
|
void activateSelectToolOnClick();
|
|
|
|
void activateMarqueeSelectToolOnClick();
|
|
|
|
void activateZoomOnClick();
|
|
|
|
|
|
|
|
void activateFromQml();
|
|
|
|
void activateToQml();
|
|
|
|
|
2011-03-16 19:59:49 +01:00
|
|
|
void changeAnimationSpeed();
|
2010-08-24 18:40:57 +02:00
|
|
|
|
|
|
|
void updatePlayAction();
|
|
|
|
|
2010-07-08 14:00:33 +02:00
|
|
|
private:
|
|
|
|
class Ui {
|
|
|
|
public:
|
2010-07-12 12:02:35 +02:00
|
|
|
QAction *designmode;
|
2010-07-08 14:00:33 +02:00
|
|
|
QAction *play;
|
|
|
|
QAction *select;
|
|
|
|
QAction *selectMarquee;
|
|
|
|
QAction *zoom;
|
|
|
|
QAction *colorPicker;
|
|
|
|
QAction *toQml;
|
|
|
|
QAction *fromQml;
|
2010-08-24 18:40:57 +02:00
|
|
|
QIcon playIcon;
|
|
|
|
QIcon pauseIcon;
|
2010-07-08 14:00:33 +02:00
|
|
|
ToolBarColorBox *colorBox;
|
2010-08-24 18:40:57 +02:00
|
|
|
|
2011-03-16 19:59:49 +01:00
|
|
|
QActionGroup *playSpeedMenuActions;
|
2010-07-08 14:00:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
bool m_emitSignals;
|
2011-03-16 19:59:49 +01:00
|
|
|
bool m_paused;
|
2010-08-24 18:40:57 +02:00
|
|
|
qreal m_animationSpeed;
|
|
|
|
|
2010-07-08 14:00:33 +02:00
|
|
|
Constants::DesignTool m_activeTool;
|
2010-08-24 18:40:57 +02:00
|
|
|
|
2010-07-08 14:00:33 +02:00
|
|
|
Ui *ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // QMLTOOLBAR_H
|