Commit bd73ce00 authored by Volker Krause's avatar Volker Krause
Browse files

Port away from global IconSize() method

Summary: About to be deprecated in KIconThemes.

Reviewers: mlaurent

Reviewed By: mlaurent

Subscribers: kde-pim

Tags: #kde_pim

Maniphest Tasks: T11637

Differential Revision: https://phabricator.kde.org/D25955
parent 2d442329
......@@ -116,7 +116,7 @@ set(kcm_knotes_PART_SRCS configdialog/knoteconfigdialog.cpp configdialog/knotedi
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})
......
......@@ -56,7 +56,6 @@
#include <KActionCollection>
#include <KGlobalAccel>
#include <KIconEffect>
#include <KIconLoader>
#include <KLocalizedString>
#include <KMessageBox>
#include <KWindowSystem>
......@@ -72,6 +71,7 @@
#include <QDBusConnection>
#include <QFileDialog>
#include <QMenu>
#include <QStyle>
static bool qActionLessThan(const QAction *a1, const QAction *a2)
{
......@@ -510,8 +510,7 @@ void KNotesApp::updateNoteActions()
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()),
......
......@@ -31,10 +31,8 @@
#include "print/knoteprintselectthemecombobox.h"
#include <KAuthorized>
#include <KIconLoader>
#include <KLocalizedString>
#include <KNS3/DownloadDialog>
#include <KWindowSystem>
#include <QCheckBox>
#include <QApplication>
......@@ -53,13 +51,6 @@ KNoteConfigDialog::KNoteConfigDialog(const QString &title, QWidget *parent)
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"));
......
......@@ -27,10 +27,8 @@
#include "attributes/notelockattribute.h"
#include <KConfigGroup>
#include <KIconLoader>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowSystem>
#include <QApplication>
#include <QDialogButtonBox>
......@@ -50,14 +48,6 @@ KNoteSimpleConfigDialog::KNoteSimpleConfigDialog(const QString &title, QWidget *
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);
......
......@@ -47,7 +47,6 @@
#include <KComboBox>
#include <KFileCustomDialog>
#include <KIconEffect>
#include <KIconLoader>
#include <KLocalizedString>
#include <KMessageBox>
#include <KToggleAction>
......@@ -938,14 +937,10 @@ void KNote::prepare()
// 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 @@ void KNote::setColor(const QColor &fg, const QColor &bg)
// 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment