v0.74.1: the version in the status bar follows light/dark mode
It read its color from its own palette, which its stylesheet pins, so the color it got at launch survived every theme switch — pale on pale after going from dark to light.
This commit is contained in:
@@ -90,3 +90,25 @@ class TestDialogFitsTheScreen:
|
||||
dialog = self._dialog(tmp_path)
|
||||
dialog.pages_list.setCurrentRow(1)
|
||||
assert dialog.friend_pages["a"].selector is not None
|
||||
|
||||
|
||||
def test_version_label_follows_light_and_dark(qapp):
|
||||
"""It read its color from its own palette, which its stylesheet had
|
||||
pinned — so a launch in one mode left it unreadable in the other."""
|
||||
from unittest.mock import MagicMock
|
||||
from lintunes import theme
|
||||
from lintunes.gui.version_button import VersionButton
|
||||
updater = MagicMock()
|
||||
updater.short_hash.return_value = ""
|
||||
button = VersionButton(updater)
|
||||
old = theme._mode
|
||||
try:
|
||||
for mode in ("dark", "light"):
|
||||
theme._mode = mode
|
||||
button.refresh_theme()
|
||||
color = theme.text_color()
|
||||
assert f"rgba({color.red()}, {color.green()}, {color.blue()}, 140)" \
|
||||
in button.styleSheet()
|
||||
assert theme.text_color("dark") != theme.text_color("light")
|
||||
finally:
|
||||
theme._mode = old
|
||||
|
||||
Reference in New Issue
Block a user