v0.72.1: the visualizer gets its own Preferences page, sized to the style shown

This commit is contained in:
2026-10-19 23:09:20 -07:00
parent 2c379c4229
commit fb5f134045
4 changed files with 39 additions and 5 deletions
+18
View File
@@ -103,3 +103,21 @@ def test_view_menu_dark_mode_toggles_and_follows(qapp, tmp_path):
window._prefs.set("dark_mode", False) # e.g. the toolbar button
assert not action.isChecked()
theme.apply_theme(qapp, Preferences(tmp_path / "light"))
def test_visualizer_has_its_own_page_sized_to_the_style_shown(qapp, tmp_path):
from lintunes.gui.preferences_dialog import PreferencesDialog
from lintunes.preferences import Preferences
from tests.test_round40 import _FakeLastFm
PreferencesDialog._last_page = 0
dialog = PreferencesDialog(Preferences(tmp_path), _FakeLastFm())
names = [dialog.pages_list.item(i).text() for i in range(dialog.pages_list.count())]
assert names.index("Visualizer") == names.index("Appearance") + 1
stack = dialog._viz_pages
dialog._viz_radios["laser"].setChecked(True)
laser = stack.sizeHint().height()
dialog._viz_radios["radial"].setChecked(True)
radial = stack.sizeHint().height()
assert radial < laser - 100 # no laser-sized gap under radial
assert abs(radial - stack.currentWidget().sizeHint().height()) <= 2
dialog.deleteLater()