diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2016-10-25 00:05:26 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2016-10-25 20:21:49 +0000 |
commit | dc25b692fa9f5acdff1194075af4c55cacae69bf (patch) | |
tree | 03b6dd074efe7f01bed8dffda41969d4b4c32b0c | |
parent | f35d71478ddadecf5197c4c7909e2a81ceb87cb8 (diff) |
ScxmlEditor: Themable toolbar icons for Adjust and Align actions
Change-Id: Ibd3a70a17362431fb1b11aecd18e9af6276b30c3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
23 files changed, 243 insertions, 14 deletions
diff --git a/src/plugins/scxmleditor/common/common.qrc b/src/plugins/scxmleditor/common/common.qrc index b3b7bd9664..36cdafe241 100644 --- a/src/plugins/scxmleditor/common/common.qrc +++ b/src/plugins/scxmleditor/common/common.qrc @@ -1,14 +1,23 @@ <RCC> <qresource prefix="/scxmleditor"> <file>images/adjust_height.png</file> + <file>images/adjust_height@2x.png</file> <file>images/adjust_size.png</file> + <file>images/adjust_size@2x.png</file> <file>images/adjust_width.png</file> + <file>images/adjust_width@2x.png</file> <file>images/align_bottom.png</file> + <file>images/align_bottom@2x.png</file> <file>images/align_horizontal.png</file> + <file>images/align_horizontal@2x.png</file> <file>images/align_left.png</file> + <file>images/align_left@2x.png</file> <file>images/align_right.png</file> + <file>images/align_right@2x.png</file> <file>images/align_top.png</file> + <file>images/align_top@2x.png</file> <file>images/align_vertical.png</file> + <file>images/align_vertical@2x.png</file> <file>images/colorthemes.png</file> <file>images/final.png</file> <file>images/font_color.png</file> diff --git a/src/plugins/scxmleditor/common/images/adjust_height.png b/src/plugins/scxmleditor/common/images/adjust_height.png Binary files differindex 3a83883851..f3917bd462 100644 --- a/src/plugins/scxmleditor/common/images/adjust_height.png +++ b/src/plugins/scxmleditor/common/images/adjust_height.png diff --git a/src/plugins/scxmleditor/common/images/adjust_height@2x.png b/src/plugins/scxmleditor/common/images/adjust_height@2x.png Binary files differnew file mode 100644 index 0000000000..844f94d4f7 --- /dev/null +++ b/src/plugins/scxmleditor/common/images/adjust_height@2x.png diff --git a/src/plugins/scxmleditor/common/images/adjust_size.png b/src/plugins/scxmleditor/common/images/adjust_size.png Binary files differindex b95d8737a8..eb2ba0a551 100644 --- a/src/plugins/scxmleditor/common/images/adjust_size.png +++ b/src/plugins/scxmleditor/common/images/adjust_size.png diff --git a/src/plugins/scxmleditor/common/images/adjust_size@2x.png b/src/plugins/scxmleditor/common/images/adjust_size@2x.png Binary files differnew file mode 100644 index 0000000000..62162d1dc7 --- /dev/null +++ b/src/plugins/scxmleditor/common/images/adjust_size@2x.png diff --git a/src/plugins/scxmleditor/common/images/adjust_width.png b/src/plugins/scxmleditor/common/images/adjust_width.png Binary files differindex 89e509878c..a261321bb4 100644 --- a/src/plugins/scxmleditor/common/images/adjust_width.png +++ b/src/plugins/scxmleditor/common/images/adjust_width.png diff --git a/src/plugins/scxmleditor/common/images/adjust_width@2x.png b/src/plugins/scxmleditor/common/images/adjust_width@2x.png Binary files differnew file mode 100644 index 0000000000..a45e6b5d58 --- /dev/null +++ b/src/plugins/scxmleditor/common/images/adjust_width@2x.png diff --git a/src/plugins/scxmleditor/common/images/align_bottom.png b/src/plugins/scxmleditor/common/images/align_bottom.png Binary files differindex f827993a21..6b24ef1bba 100644 --- a/src/plugins/scxmleditor/common/images/align_bottom.png +++ b/src/plugins/scxmleditor/common/images/align_bottom.png diff --git a/src/plugins/scxmleditor/common/images/align_bottom@2x.png b/src/plugins/scxmleditor/common/images/align_bottom@2x.png Binary files differnew file mode 100644 index 0000000000..7dd9d41cde --- /dev/null +++ b/src/plugins/scxmleditor/common/images/align_bottom@2x.png diff --git a/src/plugins/scxmleditor/common/images/align_horizontal.png b/src/plugins/scxmleditor/common/images/align_horizontal.png Binary files differindex 876a38fdf5..e35354368f 100644 --- a/src/plugins/scxmleditor/common/images/align_horizontal.png +++ b/src/plugins/scxmleditor/common/images/align_horizontal.png diff --git a/src/plugins/scxmleditor/common/images/align_horizontal@2x.png b/src/plugins/scxmleditor/common/images/align_horizontal@2x.png Binary files differnew file mode 100644 index 0000000000..574f4dce0d --- /dev/null +++ b/src/plugins/scxmleditor/common/images/align_horizontal@2x.png diff --git a/src/plugins/scxmleditor/common/images/align_left.png b/src/plugins/scxmleditor/common/images/align_left.png Binary files differindex e015bc93e8..24a597bb59 100644 --- a/src/plugins/scxmleditor/common/images/align_left.png +++ b/src/plugins/scxmleditor/common/images/align_left.png diff --git a/src/plugins/scxmleditor/common/images/align_left@2x.png b/src/plugins/scxmleditor/common/images/align_left@2x.png Binary files differnew file mode 100644 index 0000000000..197a5b3758 --- /dev/null +++ b/src/plugins/scxmleditor/common/images/align_left@2x.png diff --git a/src/plugins/scxmleditor/common/images/align_right.png b/src/plugins/scxmleditor/common/images/align_right.png Binary files differindex c52bb1498b..edfe3bd529 100644 --- a/src/plugins/scxmleditor/common/images/align_right.png +++ b/src/plugins/scxmleditor/common/images/align_right.png diff --git a/src/plugins/scxmleditor/common/images/align_right@2x.png b/src/plugins/scxmleditor/common/images/align_right@2x.png Binary files differnew file mode 100644 index 0000000000..7e50ee7379 --- /dev/null +++ b/src/plugins/scxmleditor/common/images/align_right@2x.png diff --git a/src/plugins/scxmleditor/common/images/align_top.png b/src/plugins/scxmleditor/common/images/align_top.png Binary files differindex 0366ae8686..044ca915e5 100644 --- a/src/plugins/scxmleditor/common/images/align_top.png +++ b/src/plugins/scxmleditor/common/images/align_top.png diff --git a/src/plugins/scxmleditor/common/images/align_top@2x.png b/src/plugins/scxmleditor/common/images/align_top@2x.png Binary files differnew file mode 100644 index 0000000000..d387248dd0 --- /dev/null +++ b/src/plugins/scxmleditor/common/images/align_top@2x.png diff --git a/src/plugins/scxmleditor/common/images/align_vertical.png b/src/plugins/scxmleditor/common/images/align_vertical.png Binary files differindex 036f8d40b7..f72b06483e 100644 --- a/src/plugins/scxmleditor/common/images/align_vertical.png +++ b/src/plugins/scxmleditor/common/images/align_vertical.png diff --git a/src/plugins/scxmleditor/common/images/align_vertical@2x.png b/src/plugins/scxmleditor/common/images/align_vertical@2x.png Binary files differnew file mode 100644 index 0000000000..218c904f63 --- /dev/null +++ b/src/plugins/scxmleditor/common/images/align_vertical@2x.png diff --git a/src/plugins/scxmleditor/common/mainwidget.cpp b/src/plugins/scxmleditor/common/mainwidget.cpp index 09c00c0f62..3952b35812 100644 --- a/src/plugins/scxmleditor/common/mainwidget.cpp +++ b/src/plugins/scxmleditor/common/mainwidget.cpp @@ -289,8 +289,8 @@ void MainWidget::init() // Init ToolButtons auto stateColorButton = new ColorToolButton("StateColor", ":/scxmleditor/images/state_color.png", tr("State Color")); auto fontColorButton = new ColorToolButton("FontColor", ":/scxmleditor/images/font_color.png", tr("Font Color")); - QToolButton *alignToolButton = createToolButton(":/scxmleditor/images/align_left.png", tr("Align Left"), QToolButton::MenuButtonPopup); - QToolButton *adjustToolButton = createToolButton(":/scxmleditor/images/adjust_width.png", tr("Adjust Width"), QToolButton::MenuButtonPopup); + QToolButton *alignToolButton = createToolButton(m_actionHandler->action(ActionAlignLeft)->icon(), tr("Align Left"), QToolButton::MenuButtonPopup); + QToolButton *adjustToolButton = createToolButton(m_actionHandler->action(ActionAdjustWidth)->icon(), tr("Adjust Width"), QToolButton::MenuButtonPopup); // Connect state color change connect(stateColorButton, &ColorToolButton::colorSelected, [this](const QString &color) { @@ -725,10 +725,10 @@ void MainWidget::setMagnifier(bool m) } } -QToolButton *MainWidget::createToolButton(const QString &iconName, const QString &tooltip, QToolButton::ToolButtonPopupMode mode) +QToolButton *MainWidget::createToolButton(const QIcon &icon, const QString &tooltip, QToolButton::ToolButtonPopupMode mode) { auto button = new QToolButton; - button->setIcon(QIcon(iconName)); + button->setIcon(icon); button->setToolTip(tooltip); button->setPopupMode(mode); diff --git a/src/plugins/scxmleditor/common/mainwidget.h b/src/plugins/scxmleditor/common/mainwidget.h index 6b75895b0f..984c364f5b 100644 --- a/src/plugins/scxmleditor/common/mainwidget.h +++ b/src/plugins/scxmleditor/common/mainwidget.h @@ -108,7 +108,7 @@ signals: void dirtyChanged(bool dirty); private: - QToolButton *createToolButton(const QString &iconName, const QString &tooltip, QToolButton::ToolButtonPopupMode mode); + QToolButton *createToolButton(const QIcon &icon, const QString &tooltip, QToolButton::ToolButtonPopupMode mode); void documentChanged(); void createUi(); void init(); diff --git a/src/plugins/scxmleditor/plugin_interface/actionhandler.cpp b/src/plugins/scxmleditor/plugin_interface/actionhandler.cpp index b697e0e8d8..026e442557 100644 --- a/src/plugins/scxmleditor/plugin_interface/actionhandler.cpp +++ b/src/plugins/scxmleditor/plugin_interface/actionhandler.cpp @@ -59,15 +59,15 @@ ActionHandler::ActionHandler(QObject *parent) { Utils::Icon({{":/scxmleditor/images/icon-export-canvas.png", Utils::Theme::IconsBaseColor}}), AH::tr("Export to Image"), AH::tr("Export to Image"), "Ctrl+Shift+E", false }, { Utils::Icon(":/scxmleditor/images/fullnamespace.png"), AH::tr("Toggle Full Namespace"), AH::tr("Toggle Full Namespace"), "Ctrl+Shift+N", true }, - { Utils::Icon(":/scxmleditor/images/align_left.png"), AH::tr("Align Left"), AH::tr("Align Left (Ctrl+L,1)"), "Ctrl+L,1", false }, - { Utils::Icon(":/scxmleditor/images/align_right.png"), AH::tr("Align Right"), AH::tr("Align Right (Ctrl+L,2)"), "Ctrl+L,2", false }, - { Utils::Icon(":/scxmleditor/images/align_top.png"), AH::tr("Align Top"), AH::tr("Align Top (Ctrl+L,3)"), "Ctrl+L,3", false }, - { Utils::Icon(":/scxmleditor/images/align_bottom.png"), AH::tr("Align Bottom"), AH::tr("Align Bottom (Ctrl+L,4)"), "Ctrl+L,4", false }, - { Utils::Icon(":/scxmleditor/images/align_horizontal.png"), AH::tr("Align Horizontal"), AH::tr("Align Horizontal (Ctrl+L,5)"), "Ctrl+L,5", false }, - { Utils::Icon(":/scxmleditor/images/align_vertical.png"), AH::tr("Align Vertical"), AH::tr("Align Vertical (Ctrl+L,6)"), "Ctrl+L,6", false }, - { Utils::Icon(":/scxmleditor/images/adjust_width.png"), AH::tr("Adjust Width"), AH::tr("Adjust Width (Ctrl+L,7)"), "Ctrl+L,7", false }, - { Utils::Icon(":/scxmleditor/images/adjust_height.png"), AH::tr("Adjust Height"), AH::tr("Adjust Height (Ctrl+L,8)"), "Ctrl+L,8", false }, - { Utils::Icon(":/scxmleditor/images/adjust_size.png"), AH::tr("Adjust Size"), AH::tr("Adjust Size (Ctrl+L,9)"), "Ctrl+L,9", false }, + { Utils::Icon({{":/scxmleditor/images/align_left.png", Utils::Theme::IconsBaseColor}}), AH::tr("Align Left"), AH::tr("Align Left (Ctrl+L,1)"), "Ctrl+L,1", false }, + { Utils::Icon({{":/scxmleditor/images/align_right.png", Utils::Theme::IconsBaseColor}}), AH::tr("Align Right"), AH::tr("Align Right (Ctrl+L,2)"), "Ctrl+L,2", false }, + { Utils::Icon({{":/scxmleditor/images/align_top.png", Utils::Theme::IconsBaseColor}}), AH::tr("Align Top"), AH::tr("Align Top (Ctrl+L,3)"), "Ctrl+L,3", false }, + { Utils::Icon({{":/scxmleditor/images/align_bottom.png", Utils::Theme::IconsBaseColor}}), AH::tr("Align Bottom"), AH::tr("Align Bottom (Ctrl+L,4)"), "Ctrl+L,4", false }, + { Utils::Icon({{":/scxmleditor/images/align_horizontal.png", Utils::Theme::IconsBaseColor}}), AH::tr("Align Horizontal"), AH::tr("Align Horizontal (Ctrl+L,5)"), "Ctrl+L,5", false }, + { Utils::Icon({{":/scxmleditor/images/align_vertical.png", Utils::Theme::IconsBaseColor}}), AH::tr("Align Vertical"), AH::tr("Align Vertical (Ctrl+L,6)"), "Ctrl+L,6", false }, + { Utils::Icon({{":/scxmleditor/images/adjust_width.png", Utils::Theme::IconsBaseColor}}), AH::tr("Adjust Width"), AH::tr("Adjust Width (Ctrl+L,7)"), "Ctrl+L,7", false }, + { Utils::Icon({{":/scxmleditor/images/adjust_height.png", Utils::Theme::IconsBaseColor}}), AH::tr("Adjust Height"), AH::tr("Adjust Height (Ctrl+L,8)"), "Ctrl+L,8", false }, + { Utils::Icon({{":/scxmleditor/images/adjust_size.png", Utils::Theme::IconsBaseColor}}), AH::tr("Adjust Size"), AH::tr("Adjust Size (Ctrl+L,9)"), "Ctrl+L,9", false }, { Utils::Icon(":/scxmleditor/images/statistics.png"), AH::tr("Show Statistics..."), AH::tr("Show Statistics"), "", false } }; diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg index 0daf90e7c7..5bcdd09f53 100644 --- a/src/tools/icons/qtcreatoricons.svg +++ b/src/tools/icons/qtcreatoricons.svg @@ -3770,6 +3770,226 @@ d="m 1240,574.5 -5,0" sodipodi:nodetypes="cc" /> </g> + <g + transform="translate(176,0)" + style="display:inline" + id="src/plugins/scxmleditor/common/images/adjust_height"> + <rect + style="fill:#ffffff;fill-opacity:1" + x="1228" + y="568" + width="16" + height="16" + id="rect6782-96-0-0-7-8-1-0-4-0-1-7-9-1-9-5-6" /> + <rect + style="fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:0.5" + id="rect4532" + width="3.5" + height="13.5" + x="1229.25" + y="569.25" /> + <rect + style="fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:0.5" + id="rect4534" + width="3.5" + height="8.5" + x="1235.25" + y="569.25" /> + <path + style="stroke:#000000" + d="m 1240,569.5 3,0" + id="path4536" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="stroke:#000000" + d="m 1240,582.5 3,0" + id="path4538" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="stroke:#000000" + d="m 1241.5,569.5 c 0,13 0,13 0,13" + id="path4540" + inkscape:connector-curvature="0" /> + <rect + style="fill:#cccccc" + id="rect5232" + width="4" + height="5" + x="1235" + y="578" /> + </g> + <use + x="0" + y="0" + xlink:href="#src/plugins/scxmleditor/common/images/adjust_height" + id="src/plugins/scxmleditor/common/images/adjust_width" + transform="matrix(0,1,1,0,852,-836)" + width="100%" + height="100%" /> + <g + transform="translate(208,0)" + style="display:inline" + id="src/plugins/scxmleditor/common/images/adjust_size"> + <rect + style="fill:#ffffff;fill-opacity:1" + x="1228" + y="568" + width="16" + height="16" + id="rect6782-96-0-0-7-8-1-0-4-0-1-7-9-1-9-5-6-6" /> + <g + id="g5500"> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4536-4" + d="m 1229,569.5 3,0" + style="stroke:#000000" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4540-7" + d="m 1230.5,569.5 0,13.5" + style="stroke:#000000" /> + </g> + <g + id="g5496" + transform="matrix(0,1,-1,0,1813.5,-651.5)" /> + <use + x="0" + y="0" + xlink:href="#g5500" + id="use5504" + transform="matrix(0,1,-1,0,1812,-649)" + width="100%" + height="100%" /> + <rect + style="fill:#cccccc" + id="rect5232-6" + width="11" + height="11" + x="1232" + y="569" /> + <rect + style="fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:0.5" + id="rect4534-2" + width="4.5" + height="6.5" + x="1232.25" + y="573.25" /> + </g> + <g + transform="translate(224,0)" + style="display:inline" + id="src/plugins/scxmleditor/common/images/align_bottom"> + <rect + style="fill:#ffffff;fill-opacity:1" + x="1228" + y="568" + width="16" + height="16" + id="rect6782-96-0-0-7-8-1-0-4-0-1-7-9-1-9-5-6-3" /> + <path + style="stroke:#000000" + d="m 1243,582.5 -14,0" + id="path4540-6" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <rect + style="fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:0.5" + id="rect4534-6-5" + width="3.5" + height="11.5" + x="1229.25" + y="569.25" /> + <rect + style="fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:0.5" + id="rect4534-6-5-4" + width="3.5" + height="8.5" + x="1239.25" + y="572.25" /> + <rect + style="fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:0.5" + id="rect4534-6-5-0" + width="3.5" + height="4.5" + x="1234.25" + y="576.25" /> + </g> + <use + x="0" + y="0" + xlink:href="#src/plugins/scxmleditor/common/images/align_bottom" + id="src/plugins/scxmleditor/common/images/align_right" + transform="matrix(0,1,1,0,900,-884)" + width="100%" + height="100%" /> + <use + x="0" + y="0" + xlink:href="#src/plugins/scxmleditor/common/images/align_bottom" + id="src/plugins/scxmleditor/common/images/align_top" + transform="matrix(1,0,0,-1,32,1152)" + width="100%" + height="100%" /> + <use + x="0" + y="0" + xlink:href="#src/plugins/scxmleditor/common/images/align_bottom" + id="src/plugins/scxmleditor/common/images/align_left" + transform="matrix(0,1,-1,0,2084,-884)" + width="100%" + height="100%" /> + <g + transform="translate(288,0)" + style="display:inline" + id="src/plugins/scxmleditor/common/images/align_horizontal"> + <rect + style="fill:#ffffff;fill-opacity:1" + x="1228" + y="568" + width="16" + height="16" + id="rect6782-96-0-0-7-8-1-0-4-0-1-7-9-1-9-5-6-3-0" /> + <rect + style="fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:0.5" + id="rect4534-6-5-6" + width="3.5" + height="12.5" + x="1229.25" + y="570.25" /> + <rect + style="fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:0.5" + id="rect4534-6-5-4-0" + width="3.5" + height="8.5" + x="1239.25" + y="572.25" /> + <rect + style="fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:0.5" + id="rect4534-6-5-0-8" + width="3.5" + height="4.5" + x="1234.25" + y="574.25" /> + <path + style="stroke:#000000" + d="m 1243,576.5 -14,0" + id="path4540-6-4" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + </g> + <use + x="0" + y="0" + xlink:href="#src/plugins/scxmleditor/common/images/align_horizontal" + id="src/plugins/scxmleditor/common/images/align_vertical" + transform="matrix(0,1,1,0,964,-948)" + width="100%" + height="100%" /> </g> <g inkscape:groupmode="layer" |