diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2009-08-10 17:15:03 +0200 |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2009-08-10 17:39:20 +0200 |
commit | 13a31fe82845f8b1f4d86919080d3b2a87c4d061 (patch) | |
tree | 6ec3b5c3bc0811abca5fc84d1aa094be30d4e8c4 /tools/designer/src/components | |
parent | 35ef002453cbe9841e23a7d33064a51dbe99fb06 (diff) | |
download | qt4-tools-13a31fe82845f8b1f4d86919080d3b2a87c4d061.tar.gz |
Introducing icon theme support
Added some static functions to QIcon to support desktop
themes based on the freedesktop spec. It is not intended to
replace KIcon and the intention is to use it when available to
share icon cache between applications.
Applications currently using icon themes are Assistant, Designer
and the textedit demo.
Reviewed-by: ogoffart
Diffstat (limited to 'tools/designer/src/components')
4 files changed, 27 insertions, 7 deletions
diff --git a/tools/designer/src/components/buddyeditor/buddyeditor_plugin.cpp b/tools/designer/src/components/buddyeditor/buddyeditor_plugin.cpp index ff0c3c688e..cf838a2480 100644 --- a/tools/designer/src/components/buddyeditor/buddyeditor_plugin.cpp +++ b/tools/designer/src/components/buddyeditor/buddyeditor_plugin.cpp @@ -72,8 +72,9 @@ void BuddyEditorPlugin::initialize(QDesignerFormEditorInterface *core) m_action = new QAction(tr("Edit Buddies"), this); m_action->setObjectName(QLatin1String("__qt_edit_buddies_action")); - m_action->setIcon(QIcon(core->resourceLocation() + QLatin1String("/buddytool.png"))); - m_action->setIcon(QIcon(core->resourceLocation() + QLatin1String("/buddytool.png"))); + QIcon buddyIcon = QIcon::fromTheme("designer-edit-buddy", + QIcon(core->resourceLocation() + QLatin1String("/buddytool.png"))); + m_action->setIcon(buddyIcon); m_action->setEnabled(false); setParent(core); diff --git a/tools/designer/src/components/formeditor/formwindowmanager.cpp b/tools/designer/src/components/formeditor/formwindowmanager.cpp index 993bae9055..a2a0a40535 100644 --- a/tools/designer/src/components/formeditor/formwindowmanager.cpp +++ b/tools/designer/src/components/formeditor/formwindowmanager.cpp @@ -443,7 +443,8 @@ void FormWindowManager::setupActions() m_actionVerticalLayout->setEnabled(false); connect(m_actionVerticalLayout, SIGNAL(triggered()), this, SLOT(createLayout())); - QAction *actionFormLayout = new QAction(createIconSet(QLatin1String("editform.png")), tr("Lay Out in a &Form Layout"), this); + QIcon formIcon = QIcon::fromTheme("designer-form-layout", createIconSet(QLatin1String("editform.png"))); + QAction *actionFormLayout = new QAction(formIcon, tr("Lay Out in a &Form Layout"), this); actionFormLayout->setObjectName(QLatin1String("__qt_form_layout_action")); actionFormLayout->setShortcut(Qt::CTRL + Qt::Key_6); actionFormLayout->setStatusTip(tr("Lays out the selected widgets in a form layout")); @@ -510,15 +511,30 @@ void FormWindowManager::setupActions() m_actionUndo = m_undoGroup->createUndoAction(this); m_actionUndo->setEnabled(false); - m_actionUndo->setIcon(createIconSet(QLatin1String("undo.png"))); + + m_actionUndo->setIcon(QIcon::fromTheme("edit-undo", createIconSet(QLatin1String("undo.png")))); m_actionRedo = m_undoGroup->createRedoAction(this); m_actionRedo->setEnabled(false); - m_actionRedo->setIcon(createIconSet(QLatin1String("redo.png"))); + m_actionRedo->setIcon(QIcon::fromTheme("edit-redo", createIconSet(QLatin1String("redo.png")))); m_actionShowFormWindowSettingsDialog = new QAction(tr("Form &Settings..."), this); m_actionShowFormWindowSettingsDialog->setObjectName(QLatin1String("__qt_form_settings_action")); connect(m_actionShowFormWindowSettingsDialog, SIGNAL(triggered()), this, SLOT(slotActionShowFormWindowSettingsDialog())); m_actionShowFormWindowSettingsDialog->setEnabled(false); + + + 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())); + + // 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())); + m_actionGridLayout->setIcon(QIcon::fromTheme("designer-grid-layout", m_actionGridLayout->icon())); + m_actionHorizontalLayout->setIcon(QIcon::fromTheme("designer-horizontal-layout", m_actionHorizontalLayout->icon())); + m_actionVerticalLayout->setIcon(QIcon::fromTheme("designer-vertical-layout", m_actionVerticalLayout->icon())); + 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())); } void FormWindowManager::slotActionCutActivated() diff --git a/tools/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp b/tools/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp index e664ae7cfb..a1130410fc 100644 --- a/tools/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp +++ b/tools/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp @@ -72,7 +72,8 @@ void SignalSlotEditorPlugin::initialize(QDesignerFormEditorInterface *core) m_action = new QAction(tr("Edit Signals/Slots"), this); m_action->setObjectName(QLatin1String("__qt_edit_signals_slots_action")); m_action->setShortcut(tr("F4")); - QIcon icon(QIcon(core->resourceLocation() + QLatin1String("/signalslottool.png"))); + QIcon icon = QIcon::fromTheme("designer-edit-signals", + QIcon(core->resourceLocation() + QLatin1String("/signalslottool.png"))); m_action->setIcon(icon); m_action->setEnabled(false); diff --git a/tools/designer/src/components/tabordereditor/tabordereditor_plugin.cpp b/tools/designer/src/components/tabordereditor/tabordereditor_plugin.cpp index 9b051c9b95..ddddd083f3 100644 --- a/tools/designer/src/components/tabordereditor/tabordereditor_plugin.cpp +++ b/tools/designer/src/components/tabordereditor/tabordereditor_plugin.cpp @@ -72,7 +72,9 @@ void TabOrderEditorPlugin::initialize(QDesignerFormEditorInterface *core) m_action = new QAction(tr("Edit Tab Order"), this); m_action->setObjectName(QLatin1String("_qt_edit_tab_order_action")); - m_action->setIcon(QIcon(core->resourceLocation() + QLatin1String("/tabordertool.png"))); + QIcon icon = QIcon::fromTheme("designer-edit-tabs", + QIcon(core->resourceLocation() + QLatin1String("/tabordertool.png"))); + m_action->setIcon(icon); m_action->setEnabled(false); setParent(core); |