From c6ba779b0501d52ca4f8451ea4710a8635f5efa2 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 4 May 2020 20:58:50 +0200 Subject: [PATCH] Some further tweaks to the switch widget to make it consistent between GUI themes --- nw/additions/qswitch.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nw/additions/qswitch.py b/nw/additions/qswitch.py index 9275c0c7..b3dcabe6 100644 --- a/nw/additions/qswitch.py +++ b/nw/additions/qswitch.py @@ -106,18 +106,21 @@ class QSwitch(QAbstractButton): if self.isChecked(): trackBrush = qPalette.highlight() thumbBrush = qPalette.highlightedText() - textColor = qPalette.highlight().color() - thumbText = nwUnicode.U_CHECK + textColor = qPalette.highlight().color() + thumbText = nwUnicode.U_CHECK else: trackBrush = qPalette.dark() thumbBrush = qPalette.light() - textColor = qPalette.dark().color() - thumbText = nwUnicode.U_MULT + textColor = qPalette.dark().color() + thumbText = nwUnicode.U_MULT if self.isEnabled(): trackOpacity = 1.0 else: trackOpacity = 0.6 + trackBrush = qPalette.shadow() + thumbBrush = qPalette.mid() + textColor = qPalette.shadow().color() qPaint.setBrush(trackBrush) qPaint.setOpacity(trackOpacity)