Skip to content

Commit

Permalink
test_theme: add tooltip to color mode combo box
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Aug 5, 2024
1 parent dd00d44 commit 923eefd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion guidata/qthelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions guidata/tests/widgets/test_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
"<ul><li><b>auto</b>: follow system settings</li>"
"<li><b>light</b>: use light theme</li>"
"<li><b>dark</b>: use dark theme</li></ul>"
)
hlayout = QW.QHBoxLayout()
hlayout.addWidget(label)
hlayout.addWidget(self.combo)
Expand Down

0 comments on commit 923eefd

Please sign in to comment.