From 923eefd122519d1a1238e8d59b961a15f3db0a45 Mon Sep 17 00:00:00 2001 From: Pierre Raybaut Date: Mon, 5 Aug 2024 11:22:12 +0200 Subject: [PATCH] test_theme: add tooltip to color mode combo box --- guidata/qthelpers.py | 4 +++- guidata/tests/widgets/test_theme.py | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/guidata/qthelpers.py b/guidata/qthelpers.py index 6148416..d6ccbd0 100644 --- a/guidata/qthelpers.py +++ b/guidata/qthelpers.py @@ -225,7 +225,9 @@ def set_color_mode(mode: Literal["light", "dark", "auto"] | None = None): dpsc(QG.QPalette.Disabled, QG.QPalette.HighlightedText, disabled_color) app.setPalette(dark_palette) app.setStyleSheet( - "QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }" + "QToolTip { " + "color: white; background-color: #2a82da; border: 1px solid white;" + " }" ) elif DEFAULT_STYLES is not None: style, palette, stylesheet = DEFAULT_STYLES diff --git a/guidata/tests/widgets/test_theme.py b/guidata/tests/widgets/test_theme.py index 3be21cf..b0b7a2f 100644 --- a/guidata/tests/widgets/test_theme.py +++ b/guidata/tests/widgets/test_theme.py @@ -47,6 +47,12 @@ def setup_widgets(self): self.combo.setCurrentText(self.default_theme) self.combo.currentTextChanged.connect(self.change_color_mode) self.combo.setSizePolicy(QW.QSizePolicy.Expanding, QW.QSizePolicy.Minimum) + self.combo.setToolTip( + "Select color mode:" + "" + ) hlayout = QW.QHBoxLayout() hlayout.addWidget(label) hlayout.addWidget(self.combo)