Commit f4787b48 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Move the themedIcon code out of KoIcon.h

It's now in widgets/KoIconUtils so everyone can make use of themed
icons. KoToolBoxButton used that now to get themed toolbox icons.

In Krita, KisIconUtils now is part of KisGlobal, and all places where
krita loads an icon, now uses KisIconUtils::loadIcon, which uses
KoIconUtils::themedIcon.
parent 6aef21b5
......@@ -63,24 +63,4 @@
#define koIconWanted(comment, wantedName) (QIcon())
#define koIconNameWanted(comment, wantedName) (QString())
/// Use this function to load an icon that fits the current color theme
inline QIcon themedIcon(const QString &name, bool fast = false) {
Q_UNUSED(fast);
// try load themed icon
QColor background = qApp->palette().background().color();
bool useDarkIcons = background.value() > 100;
const char * const prefix = useDarkIcons ? "dark_" : "light_";
QString realName = QLatin1String(prefix) + name;
QIcon icon(realName);
// fallback
if (icon.isNull()) {
return QIcon::fromTheme(name);
}
return icon;
}
#endif
......@@ -57,6 +57,7 @@
#include <KisImportExportManager.h>
#include <KoToolManager.h>
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include "filter/kis_filter.h"
#include "filter/kis_filter_registry.h"
......@@ -247,7 +248,7 @@ MainWindow::MainWindow(QStringList fileNames, QWidget* parent, Qt::WindowFlags f
qApp->setActiveWindow( this );
setWindowTitle(i18n("Krita Gemini"));
setWindowIcon(koIcon("kritagemini"));
setWindowIcon(KisIconUtils::loadIcon("kritagemini"));
// Load filters and other plugins in the gui thread
Q_UNUSED(KisFilterRegistry::instance());
......
......@@ -22,6 +22,7 @@
#include "kis_debug.h"
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include "kis_selection.h"
#include "filter/kis_filter_configuration.h"
#include "kis_processing_information.h"
......@@ -131,7 +132,7 @@ void KisGeneratorLayer::accept(KisProcessingVisitor &visitor, KisUndoAdapter *un
QIcon KisGeneratorLayer::icon() const
{
return themedIcon("krita_tool_color_fill");
return KisIconUtils::loadIcon("krita_tool_color_fill");
}
KisDocumentSectionModel::PropertyList KisGeneratorLayer::sectionModelProperties() const
......
......@@ -23,6 +23,7 @@
#include "kis_debug.h"
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <KoCompositeOpRegistry.h>
#include "kis_image.h"
......@@ -118,7 +119,7 @@ void KisAdjustmentLayer::accept(KisProcessingVisitor &visitor, KisUndoAdapter *u
QIcon KisAdjustmentLayer::icon() const
{
return themedIcon("view-filter");
return KisIconUtils::loadIcon("view-filter");
}
KisDocumentSectionModel::PropertyList KisAdjustmentLayer::sectionModelProperties() const
......
......@@ -19,7 +19,7 @@
#include "kis_base_node.h"
#include <klocalizedstring.h>
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <KoProperties.h>
#include <KoColorSpace.h>
#include <KoCompositeOpRegistry.h>
......@@ -136,8 +136,8 @@ void KisBaseNode::setCompositeOp(const QString& compositeOp)
KisDocumentSectionModel::PropertyList KisBaseNode::sectionModelProperties() const
{
KisDocumentSectionModel::PropertyList l;
l << KisDocumentSectionModel::Property(i18n("Visible"), themedIcon("visible"), themedIcon("novisible"), visible(), m_d->hack_visible.isInStasis, m_d->hack_visible.stateInStasis);
l << KisDocumentSectionModel::Property(i18n("Locked"), themedIcon("layer-locked"), themedIcon("layer-unlocked"), userLocked());
l << KisDocumentSectionModel::Property(i18n("Visible"), KisIconUtils::loadIcon("visible"), KisIconUtils::loadIcon("novisible"), visible(), m_d->hack_visible.isInStasis, m_d->hack_visible.stateInStasis);
l << KisDocumentSectionModel::Property(i18n("Locked"), KisIconUtils::loadIcon("layer-locked"), KisIconUtils::loadIcon("layer-unlocked"), userLocked());
return l;
}
......
......@@ -22,6 +22,7 @@
#include <klocalizedstring.h>
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <KoColorSpace.h>
#include <KoCompositeOpRegistry.h>
......@@ -293,7 +294,7 @@ void KisCloneLayer::setCopyFromInfo(KisCloneInfo info)
QIcon KisCloneLayer::icon() const
{
return themedIcon("edit-copy");
return KisIconUtils::loadIcon("edit-copy");
}
KisDocumentSectionModel::PropertyList KisCloneLayer::sectionModelProperties() const
......
......@@ -20,6 +20,7 @@
#include "kis_effect_mask.h"
#include <KoIcon.h>
#include <kis_icon_utils.h>
KisEffectMask::KisEffectMask()
......@@ -38,6 +39,6 @@ KisEffectMask::KisEffectMask(const KisEffectMask& rhs)
QIcon KisEffectMask::icon() const
{
return themedIcon("bookmarks");
return KisIconUtils::loadIcon("bookmarks");
}
......@@ -19,7 +19,7 @@
#ifndef KIS_EXTERNAL_LAYER_IFACE_
#define KIS_EXTERNAL_LAYER_IFACE_
#include "KoIcon.h"
#include "kis_icon_utils.h"
#include "kis_types.h"
......@@ -42,7 +42,7 @@ public:
: KisLayer(image, name, opacity) {}
virtual QIcon icon() const {
return themedIcon("view-refresh");
return KisIconUtils::loadIcon("view-refresh");
}
virtual void resetCache() {
......
......@@ -18,6 +18,7 @@
*/
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <KoCompositeOpRegistry.h>
#include "kis_layer.h"
......@@ -53,7 +54,7 @@ KisFilterMask::KisFilterMask(const KisFilterMask& rhs)
QIcon KisFilterMask::icon() const
{
return themedIcon("view-filter");
return KisIconUtils::loadIcon("view-filter");
}
void KisFilterMask::setFilter(KisFilterConfiguration * filterConfig)
......
......@@ -21,6 +21,7 @@
#include "kis_group_layer.h"
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <KoCompositeOpRegistry.h>
#include <KoColorSpace.h>
#include <KoColor.h>
......@@ -131,7 +132,7 @@ const KoColorSpace * KisGroupLayer::colorSpace() const
QIcon KisGroupLayer::icon() const
{
return themedIcon("folder");
return KisIconUtils::loadIcon("folder");
}
void KisGroupLayer::setImage(KisImageWSP image)
......@@ -283,7 +284,7 @@ KisDocumentSectionModel::PropertyList KisGroupLayer::sectionModelProperties() co
{
KisDocumentSectionModel::PropertyList l = KisLayer::sectionModelProperties();
// XXX: get right icons
l << KisDocumentSectionModel::Property(i18n("Pass Through"), koIcon("passthrough-enabled"), koIcon("passthrough-disabled"), passThroughMode());
l << KisDocumentSectionModel::Property(i18n("Pass Through"), KisIconUtils::loadIcon("passthrough-enabled"), KisIconUtils::loadIcon("passthrough-disabled"), passThroughMode());
return l;
}
......
......@@ -29,6 +29,7 @@
#include <QMutexLocker>
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <KoProperties.h>
#include <KoCompositeOpRegistry.h>
#include <KoColorSpace.h>
......@@ -214,10 +215,10 @@ KisDocumentSectionModel::PropertyList KisLayer::sectionModelProperties() const
}
if (m_d->layerStyle && !m_d->layerStyle->isEmpty()) {
l << KisDocumentSectionModel::Property(i18n("Layer Style"), koIcon("layer-style-enabled"), koIcon("layer-style-disabled"), m_d->layerStyle->isEnabled());
l << KisDocumentSectionModel::Property(i18n("Layer Style"), KisIconUtils::loadIcon("layer-style-enabled"), KisIconUtils::loadIcon("layer-style-disabled"), m_d->layerStyle->isEnabled());
}
l << KisDocumentSectionModel::Property(i18n("Inherit Alpha"), themedIcon("transparency-disabled"), themedIcon("transparency-enabled"), alphaChannelDisabled());
l << KisDocumentSectionModel::Property(i18n("Inherit Alpha"), KisIconUtils::loadIcon("transparency-disabled"), KisIconUtils::loadIcon("transparency-enabled"), alphaChannelDisabled());
return l;
}
......
......@@ -25,6 +25,7 @@
#include <klocalizedstring.h>
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <KoColorSpace.h>
#include <KoColorProfile.h>
#include <KoCompositeOpRegistry.h>
......@@ -147,7 +148,7 @@ KisDocumentSectionModel::PropertyList KisPaintLayer::sectionModelProperties() co
KisDocumentSectionModel::PropertyList l = KisLayer::sectionModelProperties();
// XXX: get right icons
l << KisDocumentSectionModel::Property(i18n("Alpha Locked"), koIcon("transparency-locked"), koIcon("transparency-unlocked"), alphaLocked());
l << KisDocumentSectionModel::Property(i18n("Alpha Locked"), KisIconUtils::loadIcon("transparency-locked"), KisIconUtils::loadIcon("transparency-unlocked"), alphaLocked());
return l;
}
......
......@@ -32,6 +32,7 @@
#include "kis_pixel_selection.h"
#include "kis_undo_adapter.h"
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include "kis_thread_safe_signal_compressor.h"
......@@ -77,7 +78,7 @@ KisSelectionMask::~KisSelectionMask()
}
QIcon KisSelectionMask::icon() const {
return themedIcon("edit-paste");
return KisIconUtils::loadIcon("edit-paste");
}
void KisSelectionMask::setSelection(KisSelectionSP selection)
......@@ -113,7 +114,7 @@ void KisSelectionMask::accept(KisProcessingVisitor &visitor, KisUndoAdapter *und
KisDocumentSectionModel::PropertyList KisSelectionMask::sectionModelProperties() const
{
KisDocumentSectionModel::PropertyList l = KisBaseNode::sectionModelProperties();
l << KisDocumentSectionModel::Property(i18n("Active"), koIcon("local_selection_active"), koIcon("local_selection_inactive"), active());
l << KisDocumentSectionModel::Property(i18n("Active"), KisIconUtils::loadIcon("local_selection_active"), KisIconUtils::loadIcon("local_selection_inactive"), active());
return l;
}
......
......@@ -18,6 +18,7 @@
*/
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <KoCompositeOpRegistry.h>
#include "kis_layer.h"
......@@ -114,7 +115,7 @@ KisPaintDeviceSP KisTransformMask::paintDevice() const
QIcon KisTransformMask::icon() const
{
return themedIcon("edit-cut");
return KisIconUtils::loadIcon("edit-cut");
}
void KisTransformMask::setTransformParams(KisTransformMaskParamsInterfaceSP params)
......
......@@ -21,6 +21,7 @@
#include "kis_debug.h"
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <KoColor.h>
#include <KoColorSpace.h>
#include <KoCompositeOpRegistry.h>
......@@ -89,7 +90,7 @@ QRect KisTransparencyMask::needRect(const QRect &rect, PositionToFilthy pos) con
QIcon KisTransparencyMask::icon() const
{
return themedIcon("view-filter");
return KisIconUtils::loadIcon("view-filter");
}
bool KisTransparencyMask::accept(KisNodeVisitor &v)
......
......@@ -2,15 +2,18 @@ include(CheckFunctionExists)
check_function_exists(backtrace HAVE_BACKTRACE)
configure_file(config-debug.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-debug.h)
include_directories(${KOWIDGETS_INCLUDES})
set(kritaglobal_LIB_SRCS
kis_assert.cpp
kis_debug.cpp
kis_icon_utils.cpp
)
kde4_add_library(kritaglobal SHARED ${kritaglobal_LIB_SRCS} )
target_link_libraries(kritaglobal Qt5::Concurrent ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${KDE4_KDEUI_LIBS})
target_link_libraries(kritaglobal LINK_INTERFACE_LIBRARIES Qt5::Concurrent ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
target_link_libraries(kritaglobal kowidgets Qt5::Concurrent ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${KDE4_KDEUI_LIBS})
target_link_libraries(kritaglobal LINK_INTERFACE_LIBRARIES kowidgets Qt5::Concurrent ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
set_target_properties(kritaglobal PROPERTIES
VERSION ${GENERIC_CALLIGRA_LIB_VERSION} SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION}
......
......@@ -25,36 +25,15 @@
#include <QComboBox>
#include <QIcon>
#include "KoIcon.h"
#include <KoIconUtils.h>
#include <KoIcon.h>
namespace KisIconUtils
{
QIcon loadIcon(const QString &name) {
QString realName;
// try load themed icon
QColor background = qApp->palette().background().color();
bool useDarkIcons = background.value() > 100;
const char * const prefix = useDarkIcons ? "dark_" : "light_";
realName = QLatin1String(prefix) + name;
bool absent = KIconLoader::global()->iconPath(realName, KIconLoader::User, true).isEmpty();
if (absent) {
realName = name;
}
QIcon icon(realName);
// fallback
if (icon.isNull()) {
return QIcon::fromTheme(name);
}
return icon;
QIcon loadIcon(const QString &name)
{
return KoIconUtils::themedIcon(name);
}
bool adjustIcon(QIcon *icon)
......
......@@ -19,7 +19,7 @@
#ifndef __KIS_ICON_UTILS_H
#define __KIS_ICON_UTILS_H
#include "kritaui_export.h"
#include "kritaglobal_export.h"
class QIcon;
class QAbstractButton;
......@@ -28,35 +28,36 @@ class QAction;
class QObject;
#include <QIcon>
#include <KoIcon.h>
namespace KisIconUtils
{
/**
* Load a themed icon using its base name. Use it in
* Krita instead of previous themedIcon()
* Krita instead of previous KisIconUtils::loadIcon()
*/
KRITAUI_EXPORT QIcon loadIcon(const QString &name);
KRITAGLOBAL_EXPORT QIcon loadIcon(const QString &name);
/**
* This function updates an icon of \p object depending on its
* type. See updateIcon() overrides to see the supported types
*/
KRITAUI_EXPORT void updateIconCommon(QObject *object);
KRITAGLOBAL_EXPORT void updateIconCommon(QObject *object);
/**
* Update an icon of \p button according to the current theme
*/
KRITAUI_EXPORT void updateIcon(QAbstractButton *button);
KRITAGLOBAL_EXPORT void updateIcon(QAbstractButton *button);
/**
* Update an icon of \p comboBox according to the current theme
*/
KRITAUI_EXPORT void updateIcon(QComboBox *comboBox);
KRITAGLOBAL_EXPORT void updateIcon(QComboBox *comboBox);
/**
* Update an icon of \p action according to the current theme
*/
KRITAUI_EXPORT void updateIcon(QAction *action);
KRITAGLOBAL_EXPORT void updateIcon(QAction *action);
}
#endif /* __KIS_ICON_UTILS_H */
......@@ -31,6 +31,7 @@
#include <QMessageBox>
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <KoFileDialog.h>
#include <KoViewConverter.h>
#include <KoPointerEvent.h>
......@@ -570,10 +571,10 @@ void KisRulerAssistantTool::paint(QPainter& _gc, const KoViewConverter &_convert
KisPaintingAssistant::drawPath(_gc, path);
}
QPixmap iconDelete = themedIcon("edit-delete").pixmap(16, 16);
QPixmap iconSnapOn = koIcon("visible").pixmap(16, 16);
QPixmap iconSnapOff = koIcon("novisible").pixmap(16, 16);
QPixmap iconMove = koIcon("transform-move").pixmap(32, 32);
QPixmap iconDelete = KisIconUtils::loadIcon("edit-delete").pixmap(16, 16);
QPixmap iconSnapOn = KisIconUtils::loadIcon("visible").pixmap(16, 16);
QPixmap iconSnapOff = KisIconUtils::loadIcon("novisible").pixmap(16, 16);
QPixmap iconMove = KisIconUtils::loadIcon("transform-move").pixmap(32, 32);
foreach(KisPaintingAssistant* assistant, m_canvas->paintingAssistantsDecoration()->assistants()) {
if(assistant->id()=="perspective") {
assistant->findHandleLocation();
......@@ -798,9 +799,9 @@ QWidget *KisRulerAssistantTool::createOptionWidget()
specialSpacer->setFixedSize(0, 0);
m_optionsWidget->layout()->addWidget(specialSpacer);
m_options.loadButton->setIcon(themedIcon("document-open"));
m_options.saveButton->setIcon(themedIcon("document-save"));
m_options.deleteButton->setIcon(themedIcon("edit-delete"));
m_options.loadButton->setIcon(KisIconUtils::loadIcon("document-open"));
m_options.saveButton->setIcon(KisIconUtils::loadIcon("document-save"));
m_options.deleteButton->setIcon(KisIconUtils::loadIcon("edit-delete"));
foreach(const QString& key, KisPaintingAssistantFactoryRegistry::instance()->keys()) {
QString name = KisPaintingAssistantFactoryRegistry::instance()->get(key)->name();
m_options.comboBox->addItem(name, key);
......
......@@ -23,6 +23,7 @@
#include "kis_painting_assistant.h"
#include "ui_AssistantsToolOptions.h"
#include <KoIcon.h>
#include <kis_icon_utils.h>
class KisCanvas2;
......
......@@ -31,6 +31,7 @@
#include <KoDialog.h>
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <QMessageBox>
......@@ -43,7 +44,7 @@ KisActionsEditor::KisActionsEditor(QWidget* parent) : QWidget(parent), m_current
m_form->setupUi(this);
// Setup buttons
m_form->bnAdd->setIcon(themedIcon("list-add"));
m_form->bnAdd->setIcon(KisIconUtils::loadIcon("list-add"));
QSignalMapper* mapper = new QSignalMapper(this);
connect(mapper, SIGNAL(mapped(QString)), SLOT(slotCreateAction(QString)));
QMenu* addMenu = new QMenu;
......@@ -55,16 +56,16 @@ KisActionsEditor::KisActionsEditor(QWidget* parent) : QWidget(parent), m_current
m_form->bnAdd->setMenu(addMenu);
m_form->bnDelete->setIcon(themedIcon("edit-delete"));
m_form->bnDelete->setIcon(KisIconUtils::loadIcon("edit-delete"));
connect(m_form->bnDelete, SIGNAL(released()), SLOT(slotBtnDelete()));
m_form->bnRaise->setIcon(themedIcon("arrow-up"));
m_form->bnRaise->setIcon(KisIconUtils::loadIcon("arrow-up"));
connect(m_form->bnRaise, SIGNAL(released()), SLOT(slotBtnRaise()));
m_form->bnLower->setIcon(themedIcon("arrow-down"));
m_form->bnLower->setIcon(KisIconUtils::loadIcon("arrow-down"));
connect(m_form->bnLower, SIGNAL(released()), SLOT(slotBtnLower()));
m_form->bnDuplicate->setIcon(themedIcon("edit-copy"));
m_form->bnDuplicate->setIcon(KisIconUtils::loadIcon("edit-copy"));
connect(m_form->bnDuplicate, SIGNAL(released()), SLOT(slotBtnDuplicate()));
// Setup actions list
......
......@@ -25,6 +25,7 @@
#include <klocalizedstring.h>
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <KoUpdater.h>
#include <KoResourceServerProvider.h>
#include <KoFileDialog.h>
......@@ -83,23 +84,23 @@ BigBrotherPlugin::BigBrotherPlugin(QObject *parent, const QVariantList &)
KisAction* action = 0;
// Open and play action
action = new KisAction(themedIcon("media-playback-start"), i18n("Open and play..."), this);
action = new KisAction(KisIconUtils::loadIcon("media-playback-start"), i18n("Open and play..."), this);
addAction("Macro_Open_Play", action);
connect(action, SIGNAL(triggered()), this, SLOT(slotOpenPlay()));
// Open and edit action
action = new KisAction(themedIcon("document-edit"), i18n("Open and edit..."), this);
action = new KisAction(KisIconUtils::loadIcon("document-edit"), i18n("Open and edit..."), this);
addAction("Macro_Open_Edit", action);
connect(action, SIGNAL(triggered()), this, SLOT(slotOpenEdit()));
// Start recording action
m_startRecordingMacroAction = new KisAction(themedIcon("media-record"), i18n("Start recording macro"), this);
m_startRecordingMacroAction = new KisAction(KisIconUtils::loadIcon("media-record"), i18n("Start recording macro"), this);
m_startRecordingMacroAction->setActivationFlags(KisAction::ACTIVE_NODE);
addAction("Recording_Start_Recording_Macro", m_startRecordingMacroAction);
connect(m_startRecordingMacroAction, SIGNAL(triggered()), this, SLOT(slotStartRecordingMacro()));
// Save recorded action
m_stopRecordingMacroAction = new KisAction(themedIcon("media-playback-stop"), i18n("Stop recording actions"), this);
m_stopRecordingMacroAction = new KisAction(KisIconUtils::loadIcon("media-playback-stop"), i18n("Stop recording actions"), this);
m_stopRecordingMacroAction->setActivationFlags(KisAction::ACTIVE_NODE);
addAction("Recording_Stop_Recording_Macro", m_stopRecordingMacroAction);
connect(m_stopRecordingMacroAction, SIGNAL(triggered()), this, SLOT(slotStopRecordingMacro()));
......
......@@ -32,7 +32,7 @@
#include <kis_debug.h>
#include <KoCanvasResourceManager.h>
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include "kis_color_selector_ring.h"
#include "kis_color_selector_triangle.h"
......@@ -327,7 +327,7 @@ void KisColorSelector::init()
if(displaySettingsButton()) {
m_button = new QPushButton(this);
m_button->setIcon(themedIcon("configure"));
m_button->setIcon(KisIconUtils::loadIcon("configure"));
connect(m_button, SIGNAL(clicked()), SIGNAL(settingsButtonClicked()));
}
......
......@@ -27,7 +27,7 @@
#include <kconfiggroup.h>
#include <kglobal.h>
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include "KoColorSpace.h"
#include "KoColorSpaceRegistry.h"
#include "KoColorProfile.h"
......@@ -156,7 +156,7 @@ QString KisColorSelectorSettings::header()
QIcon KisColorSelectorSettings::icon()
{
return koIcon("extended_color_selector");
return KisIconUtils::loadIcon("extended_color_selector");
}
......
......@@ -29,7 +29,7 @@
#include <kglobal.h>
#include <klocalizedstring.h>
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include "KoColor.h"
#include "kis_canvas2.h"
#include "kis_image.h"
......@@ -42,7 +42,7 @@ KisCommonColors::KisCommonColors(QWidget *parent) :
KisColorPatches("commonColors", parent)
{
m_reloadButton = new QPushButton();
m_reloadButton->setIcon(themedIcon("view-refresh"));
m_reloadButton->setIcon(KisIconUtils::loadIcon("view-refresh"));
m_reloadButton->setToolTip(i18n("Create a list of colors from the image"));
connect(m_reloadButton, SIGNAL(clicked()), this, SLOT(recalculate()));
......
......@@ -31,7 +31,7 @@
#include <klocalizedstring.h>
#include <kactioncollection.h>
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <KoCanvasBase.h>
#include <KoFileDialog.h>
......@@ -55,9 +55,9 @@ CompositionDockerDock::CompositionDockerDock( ) : QDockWidget(i18n("Compositions
m_model = new CompositionModel(this);
compositionView->setModel(m_model);
compositionView->installEventFilter(this);
deleteButton->setIcon(themedIcon("edit-delete"));
saveButton->setIcon(themedIcon("list-add"));
exportButton->setIcon(themedIcon("document-export"));
deleteButton->setIcon(KisIconUtils::loadIcon("edit-delete"));
saveButton->setIcon(KisIconUtils::loadIcon("list-add"));
exportButton->setIcon(KisIconUtils::loadIcon("document-export"));
deleteButton->setToolTip(i18n("Delete Composition"));
saveButton->setToolTip(i18n("New Composition"));
......
......@@ -17,7 +17,7 @@
#include "compositionmodel.h"
#include <KoIcon.h>
#include <kis_icon_utils.h>
#include <QAction>
#include <klocalizedstring.h>
......@@ -41,7 +41,7 @@ QVariant CompositionModel::data(const QModelIndex& index, int role) const
}
case Qt::DecorationRole:
{
return themedIcon("tools-wizard");
return KisIconUtils::loadIcon("tools-wizard");
}
case Qt::CheckStateRole: {
return m_compositions.at(index.row())->isExportEnabled() ? Qt::Checked : Qt::Unchecked;
......