diff --git a/kdecoration/CMakeLists.txt b/kdecoration/CMakeLists.txt --- a/kdecoration/CMakeLists.txt +++ b/kdecoration/CMakeLists.txt @@ -1,6 +1,6 @@ add_definitions(-DTRANSLATION_DOMAIN="breeze_kwin_deco") -find_package(KF5 REQUIRED COMPONENTS CoreAddons GuiAddons ConfigWidgets WindowSystem I18n) +find_package(KF5 REQUIRED COMPONENTS CoreAddons GuiAddons ConfigWidgets WindowSystem I18n IconThemes) find_package(Qt5 CONFIG REQUIRED COMPONENTS DBus) ### XCB @@ -82,6 +82,7 @@ KF5::ConfigWidgets KF5::GuiAddons KF5::I18n + KF5::IconThemes KF5::WindowSystem) if(BREEZE_HAVE_X11) diff --git a/kdecoration/breezebutton.cpp b/kdecoration/breezebutton.cpp --- a/kdecoration/breezebutton.cpp +++ b/kdecoration/breezebutton.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -143,8 +144,20 @@ { const QRectF iconRect( geometry().topLeft(), m_iconSize ); - decoration()->client().data()->icon().paint(painter, iconRect.toRect()); - + if (auto deco = qobject_cast(decoration())) { + const QPalette activePalette = KIconLoader::global()->customPalette(); + QPalette palette = decoration()->client().data()->palette(); + palette.setColor(QPalette::Foreground, deco->fontColor()); + KIconLoader::global()->setCustomPalette(palette); + decoration()->client().data()->icon().paint(painter, iconRect.toRect()); + if (activePalette == QPalette()) { + KIconLoader::global()->resetPalette(); + } else { + KIconLoader::global()->setCustomPalette(palette); + } + } else { + decoration()->client().data()->icon().paint(painter, iconRect.toRect()); + } } else {