summaryrefslogtreecommitdiff
blob: 85258c851f74e3b966750512015ea3cc1da7e8a9 (plain)
1
2
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
From 8cc32d94b4c9de74b5bcf27fae2d10e6b2b11caf Mon Sep 17 00:00:00 2001
From: Tsu Jan <tsujan2000@gmail.com>
Date: Mon, 1 Jun 2020 22:20:22 +0430
Subject: [PATCH] Do not reset widget palettes on changing style
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Generally, resetting a widget's palette from outside its code is a bad practice because the palette may have been changed for a reason.

If the custom palette of a widget needs an update when the style changes, the program itself is responsible for that; otherwise, the program has a bug — as in libfm-qt's places view (which I'll fix soon) and Dolphin's main view (which will never be fixed).
---
 src/lxqtplatformtheme.cpp | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/lxqtplatformtheme.cpp b/src/lxqtplatformtheme.cpp
index 2df9f8f..76f6483 100644
--- a/src/lxqtplatformtheme.cpp
+++ b/src/lxqtplatformtheme.cpp
@@ -234,10 +234,6 @@ void LXQtPlatformTheme::onSettingsChanged() {
         // Qt5 added a QEvent::ThemeChange event.
         QEvent event(QEvent::ThemeChange);
         QApplication::sendEvent(widget, &event);
-        // Also, set the palette because it may not be updated for some widgets.
-        // WARNING: The app palette should be used, not LXQtPalette_, because
-        // some widget styles have their own palettes.
-        widget->setPalette(QApplication::palette());
     }
 }