| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 
 | From bd4d17996062ad0a78a0157cdc17603ccbf8a0ea Mon Sep 17 00:00:00 2001
From: Marco Martin <notmart@gmail.com>
Date: Tue, 27 May 2025 11:53:38 +0200
Subject: [PATCH] Fix header colors of QWidget based KCMs
If we create a QPalette from scratch for the KCM header,
we won't be notified anymore about palette changes, so when
changing the color scheme the PaletteChanged events won't arrive.
if we instead start form QWidget::palette() and then modify it
we will get the events and the color scheme changes will be applied
immediately
BUG:495462
(cherry picked from commit 314c6e87bdca262b3ce7e863d7a79657e937f51f)
314c6e87 Fix header colors of QWidget based KCMs
Co-authored-by: Marco Martin <notmart@gmail.com>
---
 app/ModuleView.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/ModuleView.cpp b/app/ModuleView.cpp
index d06c24e5a..2b359d448 100644
--- a/app/ModuleView.cpp
+++ b/app/ModuleView.cpp
@@ -81,7 +81,7 @@ void CustomTitle::colorsChanged()
     auto inactive = KColorScheme(QPalette::Inactive, KColorScheme::Header, config);
     auto disabled = KColorScheme(QPalette::Disabled, KColorScheme::Header, config);
 
-    QPalette palette = KColorScheme::createApplicationPalette(config);
+    QPalette palette = QWidget::palette();
 
     palette.setBrush(QPalette::Active, QPalette::Window, active.background());
     palette.setBrush(QPalette::Active, QPalette::WindowText, active.foreground());
-- 
GitLab
 |