v0.45.1: the laser's Afterimage is a number box, like Line width

Type the seconds, or step by 0.05 with the arrows or ↑/↓; it reads "Off"
at zero. Line width and Afterimage now share one number-box helper.
This commit is contained in:
2026-10-10 02:24:17 -07:00
parent 43d2d21d9d
commit c312751c86
4 changed files with 40 additions and 18 deletions
+6 -3
View File
@@ -614,12 +614,15 @@ class TestPreferencesPage:
prefs = Preferences(tmp_path)
dialog = self._dialog(prefs)
for slider, key in ((dialog._bars_fade_slider, "visualizer_bars_fade"),
(dialog._fade_slider, "visualizer_ghost_fade"),
(dialog._laser_fade_slider,
"visualizer_laser_afterimage")):
(dialog._fade_slider, "visualizer_ghost_fade")):
assert slider.minimum() == 0 # 0 = off
slider.setValue(10)
assert prefs.get(key) == 0.5
# The laser's is a number box, like Line width.
box = dialog._laser_fade_box
assert box.minimum() == 0
box.setValue(0.5)
assert prefs.get("visualizer_laser_afterimage") == 0.5
def test_laser_settings(self, qapp, tmp_path):
prefs = Preferences(tmp_path)
+13
View File
@@ -282,3 +282,16 @@ class TestCopyAsText:
from lintunes.gui.track_table import song_line
from lintunes.models import Track
assert song_line(Track(track_id=9, name="", artist="X")) == "X - Untitled"
class TestAfterimageBox:
def test_steps_by_a_twentieth_and_reads_off_at_zero(self, qapp, tmp_path):
prefs = Preferences(tmp_path)
box = _prefs_dialog(prefs)._laser_fade_box
assert box.value() == pytest.approx(0.1) # the default
box.stepUp()
assert prefs.get("visualizer_laser_afterimage") == pytest.approx(0.15)
box.setValue(0)
assert box.text() == "Off"
box.setValue(99) # past the top
assert box.value() == 3.0