Skip to content

Commit 923eefd

Browse files
committed
test_theme: add tooltip to color mode combo box
1 parent dd00d44 commit 923eefd

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

guidata/qthelpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ def set_color_mode(mode: Literal["light", "dark", "auto"] | None = None):
225225
dpsc(QG.QPalette.Disabled, QG.QPalette.HighlightedText, disabled_color)
226226
app.setPalette(dark_palette)
227227
app.setStyleSheet(
228-
"QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }"
228+
"QToolTip { "
229+
"color: white; background-color: #2a82da; border: 1px solid white;"
230+
" }"
229231
)
230232
elif DEFAULT_STYLES is not None:
231233
style, palette, stylesheet = DEFAULT_STYLES

guidata/tests/widgets/test_theme.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ def setup_widgets(self):
4747
self.combo.setCurrentText(self.default_theme)
4848
self.combo.currentTextChanged.connect(self.change_color_mode)
4949
self.combo.setSizePolicy(QW.QSizePolicy.Expanding, QW.QSizePolicy.Minimum)
50+
self.combo.setToolTip(
51+
"Select color mode:"
52+
"<ul><li><b>auto</b>: follow system settings</li>"
53+
"<li><b>light</b>: use light theme</li>"
54+
"<li><b>dark</b>: use dark theme</li></ul>"
55+
)
5056
hlayout = QW.QHBoxLayout()
5157
hlayout.addWidget(label)
5258
hlayout.addWidget(self.combo)

0 commit comments

Comments
 (0)