feat: add volume control with the right stick and keys

Right stick up and down change the volume in steps of 5 and clicking it
mutes; + (or =), - and m do the same on a keyboard, on every screen. The
stick's dominant axis wins, so a diagonal push does not seek and change
the volume at once. Any step unmutes.

The level goes to playbin's volume on a cubic scale, so steps sound
even, and to its mute. A pill shows the level for a moment after each
change, the now-playing screen shows it under the times, and it is
saved in settings.toml once the changes stop and on quit.

Hint icons for the right stick and the keys are from Kenney's Input
Prompts 1.5, like the others.
This commit is contained in:
Ansho Rei
2026-11-04 15:18:17 +01:00
parent 5e1e120457
commit 0e7c63c09a
22 changed files with 349 additions and 6 deletions
+3
View File
@@ -91,6 +91,9 @@ fn step(ui: slint::Weak<AppWindow>, steps: Vec<String>, i: usize) {
"now-playing" => Action::NowPlaying,
"search" => Action::Search,
"quit" => Action::Quit,
"volume-up" => Action::VolumeUp,
"volume-down" => Action::VolumeDown,
"mute" => Action::ToggleMute,
other => {
log::warn!("unknown dev script step {other}");
Action::None