summaryrefslogtreecommitdiff
path: root/lxqt-base/lxqt-qtplugin/files/lxqt-qtplugin-0.15.1-adjust-highlight-colour.patch
blob: b25b3254173dfd049638641511a8db00d1414511 (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
From 5858386839d499c032d62c9d10301dc09421de27 Mon Sep 17 00:00:00 2001
From: Tsu Jan <tsujan2000@gmail.com>
Date: Mon, 8 Jun 2020 01:49:41 +0430
Subject: [PATCH] Enforce Fusion's highlight color when setting window color

Because Qt's default highlight color is `#000080` while that of Fusion is `#3c8ce6`. Not only the latter is more elegant but also the patch fixes the color change after restarting apps.

Also, the highlighted text color is set to white for the sake of certainty.
---
 src/lxqtplatformtheme.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lxqtplatformtheme.cpp b/src/lxqtplatformtheme.cpp
index 76f6483..3edc5b1 100644
--- a/src/lxqtplatformtheme.cpp
+++ b/src/lxqtplatformtheme.cpp
@@ -134,6 +134,9 @@ void LXQtPlatformTheme::loadSettings() {
         if(LXQtPalette_)
             delete LXQtPalette_;
         LXQtPalette_ = new QPalette(winColor_);
+        // Qt's default highlight color and that of Fusion may be different. This is a workaround:
+        LXQtPalette_->setColor(QPalette::Highlight, QColor(60, 140, 230));
+        LXQtPalette_->setColor(QPalette::HighlightedText, QColor(255, 255, 255));
     }
 
     // SystemFont