diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -116,7 +116,7 @@ add_library(kcm_knote MODULE ${kcm_knotes_PART_SRCS} ) -target_link_libraries(kcm_knote knotesprivate KF5::AkonadiCore KF5::KCMUtils KF5::NewStuff KF5::WindowSystem notesharedprivate KF5::AkonadiNotes KF5::PimCommon KF5::I18n KF5::AkonadiWidgets) +target_link_libraries(kcm_knote knotesprivate KF5::AkonadiCore KF5::KCMUtils KF5::NewStuff notesharedprivate KF5::AkonadiNotes KF5::PimCommon KF5::I18n KF5::AkonadiWidgets) install(TARGETS kcm_knote DESTINATION ${KDE_INSTALL_PLUGINDIR}) diff --git a/src/apps/knotesapp.cpp b/src/apps/knotesapp.cpp --- a/src/apps/knotesapp.cpp +++ b/src/apps/knotesapp.cpp @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include @@ -72,6 +71,7 @@ #include #include #include +#include static bool qActionLessThan(const QAction *a1, const QAction *a2) { @@ -510,8 +510,7 @@ connect(action, &QAction::triggered, this, &KNotesApp::slotShowNote); KIconEffect effect; QPixmap icon - = effect.apply(qApp->windowIcon().pixmap(IconSize(KIconLoader::Small), - IconSize(KIconLoader::Small)), + = effect.apply(qApp->windowIcon().pixmap(style()->pixelMetric(QStyle::PM_SmallIconSize)), KIconEffect::Colorize, 1, note->palette().color(note->backgroundRole()), diff --git a/src/configdialog/knoteconfigdialog.cpp b/src/configdialog/knoteconfigdialog.cpp --- a/src/configdialog/knoteconfigdialog.cpp +++ b/src/configdialog/knoteconfigdialog.cpp @@ -31,10 +31,8 @@ #include "print/knoteprintselectthemecombobox.h" #include -#include #include #include -#include #include #include @@ -53,13 +51,6 @@ button(QDialogButtonBox::Ok)->setDefault(true); setWindowTitle(title); - KWindowSystem::setIcons(winId(), - qApp->windowIcon().pixmap( - IconSize(KIconLoader::Desktop), - IconSize(KIconLoader::Desktop)), - qApp->windowIcon().pixmap( - IconSize(KIconLoader::Small), - IconSize(KIconLoader::Small))); addModule(QStringLiteral("knote_config_display")); addModule(QStringLiteral("knote_config_editor")); addModule(QStringLiteral("knote_config_action")); diff --git a/src/configdialog/knotesimpleconfigdialog.cpp b/src/configdialog/knotesimpleconfigdialog.cpp --- a/src/configdialog/knotesimpleconfigdialog.cpp +++ b/src/configdialog/knotesimpleconfigdialog.cpp @@ -27,10 +27,8 @@ #include "attributes/notelockattribute.h" #include -#include #include #include -#include #include #include @@ -50,14 +48,6 @@ connect(buttonBox, &QDialogButtonBox::accepted, this, &KNoteSimpleConfigDialog::accept); connect(buttonBox, &QDialogButtonBox::rejected, this, &KNoteSimpleConfigDialog::reject); - setWindowTitle(title); - KWindowSystem::setIcons(winId(), - qApp->windowIcon().pixmap( - IconSize(KIconLoader::Desktop), - IconSize(KIconLoader::Desktop)), - qApp->windowIcon().pixmap( - IconSize(KIconLoader::Small), - IconSize(KIconLoader::Small))); mTabWidget = new QTabWidget; mEditorConfigWidget = new KNoteEditorConfigWidget(this); diff --git a/src/notes/knote.cpp b/src/notes/knote.cpp --- a/src/notes/knote.cpp +++ b/src/notes/knote.cpp @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -938,14 +937,10 @@ // aware of the new colors KIconEffect effect; const QColor col = mDisplayAttribute->backgroundColor(); - const QPixmap icon = effect.apply(qApp->windowIcon().pixmap( - IconSize(KIconLoader::Desktop), - IconSize(KIconLoader::Desktop)), + const QPixmap icon = effect.apply(qApp->windowIcon().pixmap(style()->pixelMetric(QStyle::PM_MessageBoxIconSize)), KIconEffect::Colorize, 1, col, false); - const QPixmap miniIcon = effect.apply(qApp->windowIcon().pixmap( - IconSize(KIconLoader::Small), - IconSize(KIconLoader::Small)), + const QPixmap miniIcon = effect.apply(qApp->windowIcon().pixmap(style()->pixelMetric(QStyle::PM_SmallIconSize)), KIconEffect::Colorize, 1, col, false); KWindowSystem::setIcons(winId(), icon, miniIcon); @@ -1022,13 +1017,9 @@ // update the icon color KIconEffect effect; - QPixmap icon = effect.apply(qApp->windowIcon().pixmap( - IconSize(KIconLoader::Desktop), - IconSize(KIconLoader::Desktop)), + QPixmap icon = effect.apply(qApp->windowIcon().pixmap(style()->pixelMetric(QStyle::PM_MessageBoxIconSize)), KIconEffect::Colorize, 1, bg, false); - QPixmap miniIcon = effect.apply(qApp->windowIcon().pixmap( - IconSize(KIconLoader::Small), - IconSize(KIconLoader::Small)), + QPixmap miniIcon = effect.apply(qApp->windowIcon().pixmap(style()->pixelMetric(QStyle::PM_SmallIconSize)), KIconEffect::Colorize, 1, bg, false); KWindowSystem::setIcons(winId(), icon, miniIcon); // update the color of the title