From 0b312175febbf2fff73da59736c45c2da02d275d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Tue, 23 Mar 2010 12:12:26 +0100 Subject: Use more standard icons for standard actions in Designer Added standard theme icons for Save As, Print, Close, Quit, Recent Files and Clear Recent Files. Also slighly optimize non-X11 platforms by not calling QIcon::fromTheme at all. Reviewed-by: Jens Bache-Wiig --- tools/designer/src/components/formeditor/formwindowmanager.cpp | 4 +++- tools/designer/src/designer/qdesigner_actions.cpp | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/designer/src/components/formeditor/formwindowmanager.cpp b/tools/designer/src/components/formeditor/formwindowmanager.cpp index 88b4ac5..ce809ff 100644 --- a/tools/designer/src/components/formeditor/formwindowmanager.cpp +++ b/tools/designer/src/components/formeditor/formwindowmanager.cpp @@ -523,10 +523,11 @@ void FormWindowManager::setupActions() connect(m_actionShowFormWindowSettingsDialog, SIGNAL(triggered()), this, SLOT(slotActionShowFormWindowSettingsDialog())); m_actionShowFormWindowSettingsDialog->setEnabled(false); - +#ifdef Q_WS_X11 m_actionCopy->setIcon(QIcon::fromTheme("edit-copy", m_actionCopy->icon())); m_actionCut->setIcon(QIcon::fromTheme("edit-cut", m_actionCut->icon())); m_actionPaste->setIcon(QIcon::fromTheme("edit-paste", m_actionPaste->icon())); + m_actionDelete->setIcon(QIcon::fromTheme("edit-delete", m_actionDelete->icon())); // These do not currently exist, but will allow theme authors to fill in the gaps m_actionBreakLayout->setIcon(QIcon::fromTheme("designer-break-layout", m_actionBreakLayout->icon())); @@ -536,6 +537,7 @@ void FormWindowManager::setupActions() m_actionSplitHorizontal->setIcon(QIcon::fromTheme("designer-split-horizontal", m_actionSplitHorizontal->icon())); m_actionSplitVertical->setIcon(QIcon::fromTheme("designer-split-vertical", m_actionSplitVertical->icon())); m_actionAdjustSize->setIcon(QIcon::fromTheme("designer-adjust-size", m_actionAdjustSize->icon())); +#endif } void FormWindowManager::slotActionCutActivated() diff --git a/tools/designer/src/designer/qdesigner_actions.cpp b/tools/designer/src/designer/qdesigner_actions.cpp index 887ba98..6776351 100644 --- a/tools/designer/src/designer/qdesigner_actions.cpp +++ b/tools/designer/src/designer/qdesigner_actions.cpp @@ -200,9 +200,15 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) #endif m_previewManager(0) { +#ifdef Q_WS_X11 m_newFormAction->setIcon(QIcon::fromTheme("document-new", m_newFormAction->icon())); m_openFormAction->setIcon(QIcon::fromTheme("document-open", m_openFormAction->icon())); m_saveFormAction->setIcon(QIcon::fromTheme("document-save", m_saveFormAction->icon())); + m_saveFormAsAction->setIcon(QIcon::fromTheme("document-save-as", m_saveFormAsAction->icon())); + m_printPreviewAction->setIcon(QIcon::fromTheme("document-print", m_printPreviewAction->icon())); + m_closeFormAction->setIcon(QIcon::fromTheme("window-close", m_closeFormAction->icon())); + m_quitAction->setIcon(QIcon::fromTheme("application-exit", m_quitAction->icon())); +#endif Q_ASSERT(m_core != 0); qdesigner_internal::QDesignerFormWindowManager *ifwm = qobject_cast(m_core->formWindowManager()); @@ -490,13 +496,13 @@ QAction *QDesignerActions::createRecentFilesMenu() } updateRecentFileActions(); menu->addSeparator(); - act = new QAction(tr("Clear &Menu"), this); + act = new QAction(QIcon::fromTheme("edit-clear"), tr("Clear &Menu"), this); act->setObjectName(QLatin1String("__qt_action_clear_menu_")); connect(act, SIGNAL(triggered()), this, SLOT(clearRecentFiles())); m_recentFilesActions->addAction(act); menu->addAction(act); - act = new QAction(tr("&Recent Forms"), this); + act = new QAction(QIcon::fromTheme("document-open-recent"), tr("&Recent Forms"), this); act->setMenu(menu); return act; } -- cgit v0.12