Utils: Create _TOOLBAR variants of some standard icons

And use these in scxmleditor. qmldesigner will also use them.

Change-Id: Ifd057531873a8cb8da3d6e033fbf606f17638c3e
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Alessandro Portale
2016-12-12 12:55:19 +01:00
parent 6bb0880a6b
commit 1ff8b46d0a
4 changed files with 21 additions and 5 deletions

View File

@@ -84,14 +84,24 @@ const Icon SAVEFILE_TOOLBAR({
{QLatin1String(":/utils/images/filesave.png"), Theme::IconsBaseColor}});
const Icon UNDO({
{QLatin1String(":/utils/images/undo.png"), Theme::PanelTextColorMid}}, Icon::Tint);
const Icon UNDO_TOOLBAR({
{QLatin1String(":/utils/images/undo.png"), Theme::IconsBaseColor}});
const Icon REDO({
{QLatin1String(":/utils/images/redo.png"), Theme::PanelTextColorMid}}, Icon::Tint);
const Icon REDO_TOOLBAR({
{QLatin1String(":/utils/images/redo.png"), Theme::IconsBaseColor}});
const Icon COPY({
{QLatin1String(":/utils/images/editcopy.png"), Theme::PanelTextColorMid}}, Icon::Tint);
const Icon COPY_TOOLBAR({
{QLatin1String(":/utils/images/editcopy.png"), Theme::IconsBaseColor}});
const Icon PASTE({
{QLatin1String(":/utils/images/editpaste.png"), Theme::PanelTextColorMid}}, Icon::Tint);
const Icon PASTE_TOOLBAR({
{QLatin1String(":/utils/images/editpaste.png"), Theme::IconsBaseColor}});
const Icon CUT({
{QLatin1String(":/utils/images/editcut.png"), Theme::PanelTextColorMid}}, Icon::Tint);
const Icon CUT_TOOLBAR({
{QLatin1String(":/utils/images/editcut.png"), Theme::IconsBaseColor}});
const Icon DIR(
QLatin1String(":/utils/images/dir.png"));
const Icon RESET({

View File

@@ -58,10 +58,15 @@ QTCREATOR_UTILS_EXPORT extern const Icon OPENFILE;
QTCREATOR_UTILS_EXPORT extern const Icon SAVEFILE;
QTCREATOR_UTILS_EXPORT extern const Icon SAVEFILE_TOOLBAR;
QTCREATOR_UTILS_EXPORT extern const Icon UNDO;
QTCREATOR_UTILS_EXPORT extern const Icon UNDO_TOOLBAR;
QTCREATOR_UTILS_EXPORT extern const Icon REDO;
QTCREATOR_UTILS_EXPORT extern const Icon REDO_TOOLBAR;
QTCREATOR_UTILS_EXPORT extern const Icon COPY;
QTCREATOR_UTILS_EXPORT extern const Icon COPY_TOOLBAR;
QTCREATOR_UTILS_EXPORT extern const Icon PASTE;
QTCREATOR_UTILS_EXPORT extern const Icon PASTE_TOOLBAR;
QTCREATOR_UTILS_EXPORT extern const Icon CUT;
QTCREATOR_UTILS_EXPORT extern const Icon CUT_TOOLBAR;
QTCREATOR_UTILS_EXPORT extern const Icon DIR;
QTCREATOR_UTILS_EXPORT extern const Icon RESET;
QTCREATOR_UTILS_EXPORT extern const Icon RESET_TOOLBAR;

View File

@@ -50,9 +50,9 @@ ActionHandler::ActionHandler(QObject *parent)
{ Utils::Icons::ZOOM_TOOLBAR, tr("Magnifier"), tr("Magnifier Tool (Alt)"), "Alt", true },
{ Utils::Icon(":/scxmleditor/images/navigator.png"), tr("Navigator"), tr("Navigator (Ctrl+E)"), "Ctrl+E", true },
{ Utils::Icon({{":/utils/images/editcopy.png", Utils::Theme::IconsBaseColor}}), tr("Copy"), tr("Copy (Ctrl + C)"), "Ctrl+C", false },
{ Utils::Icon({{":/utils/images/editcut.png", Utils::Theme::IconsBaseColor}}), tr("Cut"), tr("Cut (Ctrl + X)"), "Ctrl+X", false },
{ Utils::Icon({{":/utils/images/editpaste.png", Utils::Theme::IconsBaseColor}}), tr("Paste"), tr("Paste (Ctrl + V)"), "Ctrl+V", false },
{ Utils::Icons::COPY_TOOLBAR, tr("Copy"), tr("Copy (Ctrl + C)"), "Ctrl+C", false },
{ Utils::Icons::CUT_TOOLBAR, tr("Cut"), tr("Cut (Ctrl + X)"), "Ctrl+X", false },
{ Utils::Icons::PASTE_TOOLBAR, tr("Paste"), tr("Paste (Ctrl + V)"), "Ctrl+V", false },
{ Utils::Icons::SNAPSHOT_TOOLBAR, tr("Screenshot"), tr("Screenshot (Ctrl + Shift + C)"), "Ctrl+Shift+C", false },
{ Utils::Icon({{":/scxmleditor/images/icon-export-canvas.png", Utils::Theme::IconsBaseColor}}), tr("Export to Image"), tr("Export to Image"), "Ctrl+Shift+E", false },
{ Utils::Icon({{":/utils/images/namespace.png", Utils::Theme::IconsBaseColor}}), tr("Toggle Full Namespace"), tr("Toggle Full Namespace"), "Ctrl+Shift+N", true },

View File

@@ -46,6 +46,7 @@
#include <utils/qtcassert.h>
#include <utils/icon.h>
#include <utils/utilsicons.h>
#include <QVBoxLayout>
@@ -137,11 +138,11 @@ void ScxmlEditorData::fullInit()
// Create undo/redo group/actions
m_undoGroup = new QUndoGroup(m_widgetToolBar);
m_undoAction = m_undoGroup->createUndoAction(m_widgetToolBar);
m_undoAction->setIcon(Utils::Icon({{":/utils/images/undo.png", Utils::Theme::IconsBaseColor}}).icon());
m_undoAction->setIcon(Utils::Icons::UNDO_TOOLBAR.icon());
m_undoAction->setToolTip(tr("Undo (Ctrl + Z)"));
m_redoAction = m_undoGroup->createRedoAction(m_widgetToolBar);
m_redoAction->setIcon(Utils::Icon({{":/utils/images/redo.png", Utils::Theme::IconsBaseColor}}).icon());
m_redoAction->setIcon(Utils::Icons::REDO_TOOLBAR.icon());
m_redoAction->setToolTip(tr("Redo (Ctrl + Y)"));
ActionManager::registerAction(m_undoAction, Core::Constants::UNDO, m_contexts);