QmlDesigner: Add icons to curve editor
Change-Id: I77f9b28f8cfe04022571d9c0cc092b9206c4df60 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
@@ -42,12 +42,12 @@ CurveEditor::CurveEditor(CurveEditorModel *model, QWidget *parent)
|
|||||||
, m_tree(new TreeView(model, this))
|
, m_tree(new TreeView(model, this))
|
||||||
, m_view(new GraphicsView(model))
|
, m_view(new GraphicsView(model))
|
||||||
{
|
{
|
||||||
QSplitter *splitter = new QSplitter;
|
auto *splitter = new QSplitter;
|
||||||
splitter->addWidget(m_tree);
|
splitter->addWidget(m_tree);
|
||||||
splitter->addWidget(m_view);
|
splitter->addWidget(m_view);
|
||||||
splitter->setStretchFactor(1, 2);
|
splitter->setStretchFactor(1, 2);
|
||||||
|
|
||||||
QVBoxLayout *box = new QVBoxLayout;
|
auto *box = new QVBoxLayout;
|
||||||
box->addWidget(createToolBar());
|
box->addWidget(createToolBar());
|
||||||
box->addWidget(splitter);
|
box->addWidget(splitter);
|
||||||
setLayout(box);
|
setLayout(box);
|
||||||
@@ -72,12 +72,12 @@ void CurveEditor::clearCanvas()
|
|||||||
|
|
||||||
QToolBar *CurveEditor::createToolBar()
|
QToolBar *CurveEditor::createToolBar()
|
||||||
{
|
{
|
||||||
QToolBar *bar = new QToolBar;
|
auto *bar = new QToolBar;
|
||||||
bar->setFloatable(false);
|
bar->setFloatable(false);
|
||||||
|
|
||||||
QAction *tangentLinearAction = bar->addAction("Linear");
|
QAction *tangentLinearAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsLinearIcon.png"), "Linear");
|
||||||
QAction *tangentStepAction = bar->addAction("Step");
|
QAction *tangentStepAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsStepIcon.png"), "Step");
|
||||||
QAction *tangentSplineAction = bar->addAction("Spline");
|
QAction *tangentSplineAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsSplineIcon.png"), "Spline");
|
||||||
QAction *tangentDefaultAction = bar->addAction("Set Default");
|
QAction *tangentDefaultAction = bar->addAction("Set Default");
|
||||||
|
|
||||||
auto setLinearInterpolation = [this]() {
|
auto setLinearInterpolation = [this]() {
|
||||||
|
|||||||
@@ -44,3 +44,6 @@ SOURCES += \
|
|||||||
$$PWD/detail/utils.cpp \
|
$$PWD/detail/utils.cpp \
|
||||||
$$PWD/keyframe.cpp \
|
$$PWD/keyframe.cpp \
|
||||||
$$PWD/treeitem.cpp
|
$$PWD/treeitem.cpp
|
||||||
|
|
||||||
|
RESOURCES += \
|
||||||
|
$$PWD/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>
|
||||||
@@ -41,10 +41,10 @@ namespace DesignTools {
|
|||||||
struct TreeItemStyleOption
|
struct TreeItemStyleOption
|
||||||
{
|
{
|
||||||
double margins;
|
double margins;
|
||||||
QIcon pinnedIcon = QIcon(":/ICON_PINNED");
|
QIcon pinnedIcon = QIcon(":/curveeditor/images/treeview_pin.png");
|
||||||
QIcon unpinnedIcon = QIcon(":/ICON_UNPINNED");
|
QIcon unpinnedIcon = QIcon(":/curveeditor/images/treeview_unpin.png");
|
||||||
QIcon lockedIcon = QIcon(":/ICON_LOCKED");
|
QIcon lockedIcon = QIcon(":/curveeditor/images/treeview_lock.png");
|
||||||
QIcon unlockedIcon = QIcon(":/ICON_UNLOCKED");
|
QIcon unlockedIcon = QIcon(":/curveeditor/images/treeview_unlock.png");
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HandleItemStyleOption
|
struct HandleItemStyleOption
|
||||||
|
|||||||
|
After Width: | Height: | Size: 233 B |
|
After Width: | Height: | Size: 383 B |
|
After Width: | Height: | Size: 463 B |
|
After Width: | Height: | Size: 902 B |
|
After Width: | Height: | Size: 168 B |
|
After Width: | Height: | Size: 252 B |
|
After Width: | Height: | Size: 218 B |
|
After Width: | Height: | Size: 946 B |
|
After Width: | Height: | Size: 237 B |
|
After Width: | Height: | Size: 909 B |
|
After Width: | Height: | Size: 278 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 233 B |
|
After Width: | Height: | Size: 354 B |
|
After Width: | Height: | Size: 245 B |
|
After Width: | Height: | Size: 1.1 KiB |