aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2019-08-13 15:21:12 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2019-08-13 14:01:43 +0000
commitb6070995e055bc861ebed3cf647cf73bdaaf599e (patch)
tree338b133d9262d616cc66262e204c975b456f68b0 /src
parent3046c83f85d037d5686e625f615a1a45f675ed87 (diff)
QmlDesigner: Add icons to curve editor
Change-Id: I77f9b28f8cfe04022571d9c0cc092b9206c4df60 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/curveeditor.cpp12
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/curveeditor.pri3
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/curveeditor.qrc20
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h8
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon.pngbin0 -> 233 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon@2x.pngbin0 -> 383 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/tangetToolsSplineIcon.pngbin0 -> 463 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/tangetToolsSplineIcon@2x.pngbin0 -> 902 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon.pngbin0 -> 168 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon@2x.pngbin0 -> 252 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/treeview_eye.pngbin0 -> 218 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/treeview_eye@2x.pngbin0 -> 946 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/treeview_lock.pngbin0 -> 237 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/treeview_lock@2x.pngbin0 -> 909 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/treeview_pin.pngbin0 -> 278 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/treeview_pin@2x.pngbin0 -> 1223 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock.pngbin0 -> 233 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock@2x.pngbin0 -> 354 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin.pngbin0 -> 245 bytes
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin@2x.pngbin0 -> 1160 bytes
20 files changed, 33 insertions, 10 deletions
diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditor.cpp b/src/plugins/qmldesigner/components/curveeditor/curveeditor.cpp
index 2a1ee1c5c7..d06ea3c495 100644
--- a/src/plugins/qmldesigner/components/curveeditor/curveeditor.cpp
+++ b/src/plugins/qmldesigner/components/curveeditor/curveeditor.cpp
@@ -42,12 +42,12 @@ CurveEditor::CurveEditor(CurveEditorModel *model, QWidget *parent)
, m_tree(new TreeView(model, this))
, m_view(new GraphicsView(model))
{
- QSplitter *splitter = new QSplitter;
+ auto *splitter = new QSplitter;
splitter->addWidget(m_tree);
splitter->addWidget(m_view);
splitter->setStretchFactor(1, 2);
- QVBoxLayout *box = new QVBoxLayout;
+ auto *box = new QVBoxLayout;
box->addWidget(createToolBar());
box->addWidget(splitter);
setLayout(box);
@@ -72,12 +72,12 @@ void CurveEditor::clearCanvas()
QToolBar *CurveEditor::createToolBar()
{
- QToolBar *bar = new QToolBar;
+ auto *bar = new QToolBar;
bar->setFloatable(false);
- QAction *tangentLinearAction = bar->addAction("Linear");
- QAction *tangentStepAction = bar->addAction("Step");
- QAction *tangentSplineAction = bar->addAction("Spline");
+ QAction *tangentLinearAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsLinearIcon.png"), "Linear");
+ QAction *tangentStepAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsStepIcon.png"), "Step");
+ QAction *tangentSplineAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsSplineIcon.png"), "Spline");
QAction *tangentDefaultAction = bar->addAction("Set Default");
auto setLinearInterpolation = [this]() {
diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditor.pri b/src/plugins/qmldesigner/components/curveeditor/curveeditor.pri
index 83896f04fc..cd377aa2ce 100644
--- a/src/plugins/qmldesigner/components/curveeditor/curveeditor.pri
+++ b/src/plugins/qmldesigner/components/curveeditor/curveeditor.pri
@@ -44,3 +44,6 @@ SOURCES += \
$$PWD/detail/utils.cpp \
$$PWD/keyframe.cpp \
$$PWD/treeitem.cpp
+
+ RESOURCES += \
+ $$PWD/curveeditor.qrc
diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditor.qrc b/src/plugins/qmldesigner/components/curveeditor/curveeditor.qrc
new file mode 100644
index 0000000000..2f55372260
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/curveeditor.qrc
@@ -0,0 +1,20 @@
+<RCC>
+ <qresource prefix="/curveeditor">
+ <file>images/tangetToolsSplineIcon.png</file>
+ <file>images/tangetToolsSplineIcon@2x.png</file>
+ <file>images/tangetToolsLinearIcon.png</file>
+ <file>images/tangetToolsLinearIcon@2x.png</file>
+ <file>images/tangetToolsStepIcon.png</file>
+ <file>images/tangetToolsStepIcon@2x.png</file>
+ <file>images/treeview_eye.png</file>
+ <file>images/treeview_eye@2x.png</file>
+ <file>images/treeview_pin.png</file>
+ <file>images/treeview_pin@2x.png</file>
+ <file>images/treeview_unpin.png</file>
+ <file>images/treeview_unpin@2x.png</file>
+ <file>images/treeview_unlock@2x.png</file>
+ <file>images/treeview_lock.png</file>
+ <file>images/treeview_lock@2x.png</file>
+ <file>images/treeview_unlock.png</file>
+ </qresource>
+</RCC>
diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h b/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h
index 0ea44f2738..43e10bcd4c 100644
--- a/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h
+++ b/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h
@@ -41,10 +41,10 @@ namespace DesignTools {
struct TreeItemStyleOption
{
double margins;
- QIcon pinnedIcon = QIcon(":/ICON_PINNED");
- QIcon unpinnedIcon = QIcon(":/ICON_UNPINNED");
- QIcon lockedIcon = QIcon(":/ICON_LOCKED");
- QIcon unlockedIcon = QIcon(":/ICON_UNLOCKED");
+ QIcon pinnedIcon = QIcon(":/curveeditor/images/treeview_pin.png");
+ QIcon unpinnedIcon = QIcon(":/curveeditor/images/treeview_unpin.png");
+ QIcon lockedIcon = QIcon(":/curveeditor/images/treeview_lock.png");
+ QIcon unlockedIcon = QIcon(":/curveeditor/images/treeview_unlock.png");
};
struct HandleItemStyleOption
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon.png b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon.png
new file mode 100644
index 0000000000..a21c69eb4f
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon@2x.png
new file mode 100644
index 0000000000..09a3c0d006
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsSplineIcon.png b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsSplineIcon.png
new file mode 100644
index 0000000000..73b97dca43
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsSplineIcon.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsSplineIcon@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsSplineIcon@2x.png
new file mode 100644
index 0000000000..3c6b4584c1
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsSplineIcon@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon.png b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon.png
new file mode 100644
index 0000000000..0fed893c7e
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon@2x.png
new file mode 100644
index 0000000000..682985785c
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_eye.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_eye.png
new file mode 100644
index 0000000000..b65141f7e5
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/treeview_eye.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_eye@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_eye@2x.png
new file mode 100644
index 0000000000..54bb4339a5
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/treeview_eye@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_lock.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_lock.png
new file mode 100644
index 0000000000..1458ac23c4
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/treeview_lock.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_lock@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_lock@2x.png
new file mode 100644
index 0000000000..9a622de576
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/treeview_lock@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_pin.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_pin.png
new file mode 100644
index 0000000000..5dc71ad902
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/treeview_pin.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_pin@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_pin@2x.png
new file mode 100644
index 0000000000..6342193e1e
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/treeview_pin@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock.png
new file mode 100644
index 0000000000..b653b0c246
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock@2x.png
new file mode 100644
index 0000000000..2563d5cc64
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin.png
new file mode 100644
index 0000000000..7a0e4264fa
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin@2x.png
new file mode 100644
index 0000000000..396f6ce761
--- /dev/null
+++ b/src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin@2x.png
Binary files differ