[rkward] /: Show focus indication in highlighted item color (usually blue), instead of hardcoded red

Thomas Friedrichsmeier null at kde.org
Sun Apr 22 06:17:09 UTC 2018


Git commit 30bdd0950796fc0c11343c33a65a98a40b359f8a by Thomas Friedrichsmeier.
Committed on 22/04/2018 at 06:14.
Pushed by tfry into branch 'master'.

Show focus indication in highlighted item color (usually blue), instead of hardcoded red

This is not a fully generic solution, yet, because - as far as I understand - this is not
necessarily the platform style's focus highlighting color. However, in most cases it will
probably match, and at any rate it should be less controversial than hardcoded red.

CCBUG: 378461

M  +1    -0    ChangeLog
M  +2    -5    rkward/windows/rkmdiwindow.cpp

https://commits.kde.org/rkward/30bdd0950796fc0c11343c33a65a98a40b359f8a

diff --git a/ChangeLog b/ChangeLog
index 3e52ec77..82ec0b69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 --- Version 0.7.1 - UNRELEASED
+- Show focus indication in highlighted item color (usually blue), instead of hardcoded red
 - On Mac, do not attempt to start DBus, if it is already running
 - Fix most compiler warnings
 - File tool window gains button to switch to current working directory
diff --git a/rkward/windows/rkmdiwindow.cpp b/rkward/windows/rkmdiwindow.cpp
index 60c8e881..cc1ae522 100644
--- a/rkward/windows/rkmdiwindow.cpp
+++ b/rkward/windows/rkmdiwindow.cpp
@@ -257,11 +257,8 @@ void RKMDIWindow::paintEvent (QPaintEvent *e) {
 
 	if (isActive () && !no_border_when_active) {
 		QPainter paint (this);
-		paint.setPen (QColor (255, 0, 0));
-		paint.drawLine (0, 0, 0, height ()-1);
-		paint.drawLine (0, height ()-1, width ()-1, height ()-1);
-		paint.drawLine (0, 0, width ()-1, 0);
-		paint.drawLine (width ()-1, 0, width ()-1, height ()-1);
+		paint.setPen (QApplication::palette ().color(QPalette::Highlight));
+		paint.drawRect (0, 0, width ()-1, height ()-1);
 	}
 }
 



More information about the rkward-tracker mailing list