Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f6e303bd0f | ||
|
|
d0f1b6c95a |
@@ -2,6 +2,19 @@
|
|||||||
|
|
||||||
One section per version, newest first.
|
One section per version, newest first.
|
||||||
|
|
||||||
|
## v0.10.4 (2026-11-07)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
- The dock and taskbar show the remus icon for its window. The window now carries the app id me.anshorei.Fettleshed.Remus, which links it to the installed desktop file.
|
||||||
|
|
||||||
|
## v0.10.3 (2026-11-07)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Settings has a Controls page listing every button and key, grouped by where it works, drawn for the controller in use or the keyboard.
|
||||||
|
- The controls bar shows only the controls that depend on the selection or the screen. Back, Play / Pause, Sections, Now playing, Search, Skip, Seek, Volume and Mute, and Select where it only opens something, are on the Controls page instead. The login screen is unchanged.
|
||||||
|
|
||||||
## v0.10.2 (2026-11-06)
|
## v0.10.2 (2026-11-06)
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|||||||
Generated
+1
-1
@@ -4385,7 +4385,7 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "remus"
|
name = "remus"
|
||||||
version = "0.10.2"
|
version = "0.10.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"directories",
|
"directories",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "remus"
|
name = "remus"
|
||||||
version = "0.10.2"
|
version = "0.10.4"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ A bundle does not update itself. To update, install the next version's bundle th
|
|||||||
| | F11 | Toggle fullscreen |
|
| | F11 | Toggle fullscreen |
|
||||||
| | Ctrl+Q | Quit |
|
| | Ctrl+Q | Quit |
|
||||||
|
|
||||||
|
Settings has a Controls page with the same list, drawn with the buttons of the controller in use or the keyboard keys. The controls bar at the bottom shows only what depends on the selection, such as Add to queue on an album or Log out on a server. What works the same everywhere is left to the Controls page. The login screen shows all of its controls, since Settings cannot be reached from there.
|
||||||
|
|
||||||
With Steam running, remus listens only to Steam's virtual controller, so a pad Steam also exposes does not send every press twice. On a Deck, Steam + X opens the on-screen keyboard for the login and search fields.
|
With Steam running, remus listens only to Steam's virtual controller, so a pad Steam also exposes does not send every press twice. On a Deck, Steam + X opens the on-screen keyboard for the login and search fields.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|||||||
@@ -8,3 +8,4 @@ Terminal=false
|
|||||||
Categories=AudioVideo;Audio;Player;
|
Categories=AudioVideo;Audio;Player;
|
||||||
Keywords=music;subsonic;navidrome;player;
|
Keywords=music;subsonic;navidrome;player;
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
|
StartupWMClass=me.anshorei.Fettleshed.Remus
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
</supports>
|
</supports>
|
||||||
<content_rating type="oars-1.1"/>
|
<content_rating type="oars-1.1"/>
|
||||||
<releases>
|
<releases>
|
||||||
|
<release version="0.10.4" date="2026-11-07"/>
|
||||||
|
<release version="0.10.3" date="2026-11-07"/>
|
||||||
<release version="0.10.2" date="2026-11-06"/>
|
<release version="0.10.2" date="2026-11-06"/>
|
||||||
<release version="0.10.1" date="2026-11-06"/>
|
<release version="0.10.1" date="2026-11-06"/>
|
||||||
<release version="0.10.0" date="2026-11-06"/>
|
<release version="0.10.0" date="2026-11-06"/>
|
||||||
|
|||||||
+227
-23
@@ -131,6 +131,8 @@ enum Target {
|
|||||||
/// Starts library shuffle.
|
/// Starts library shuffle.
|
||||||
ShuffleAll,
|
ShuffleAll,
|
||||||
Setting(Setting),
|
Setting(Setting),
|
||||||
|
/// A row of the Controls page, by index into `CONTROL_ROWS`.
|
||||||
|
ControlRow(usize),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
@@ -143,8 +145,122 @@ enum Setting {
|
|||||||
/// A saved login, by index into `Logins::servers`.
|
/// A saved login, by index into `Logins::servers`.
|
||||||
Server(usize),
|
Server(usize),
|
||||||
AddServer,
|
AddServer,
|
||||||
|
/// Opens the Controls page.
|
||||||
|
Controls,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// What a row of the Controls page shows on its right.
|
||||||
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
|
enum Keys {
|
||||||
|
/// The control's icons, as the controls bar draws them.
|
||||||
|
Icons(Control),
|
||||||
|
/// Written out, for controls without icons: on a keyboard, then on a
|
||||||
|
/// controller. Empty where there is none.
|
||||||
|
Text(&'static str, &'static str),
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ControlRow {
|
||||||
|
/// Where it works: the rows are listed in groups, in this order.
|
||||||
|
group: &'static str,
|
||||||
|
label: &'static str,
|
||||||
|
keys: Keys,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Every control, for the Controls page in Settings. The controls bar shows
|
||||||
|
/// only what depends on the selection; the rest is learned here.
|
||||||
|
const CONTROL_ROWS: &[ControlRow] = &[
|
||||||
|
ControlRow {
|
||||||
|
group: "Everywhere",
|
||||||
|
label: "Move",
|
||||||
|
keys: Keys::Text("Arrow keys", "D-pad or left stick"),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Everywhere",
|
||||||
|
label: "Select",
|
||||||
|
keys: Keys::Icons(Control::Activate),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Everywhere",
|
||||||
|
label: "Back",
|
||||||
|
keys: Keys::Icons(Control::Back),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Everywhere",
|
||||||
|
label: "Play / pause",
|
||||||
|
keys: Keys::Icons(Control::PlayPause),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Everywhere",
|
||||||
|
label: "Skip track",
|
||||||
|
keys: Keys::Icons(Control::Skip),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Everywhere",
|
||||||
|
label: "Seek 10 s",
|
||||||
|
keys: Keys::Text(", / .", "Right stick left / right"),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Everywhere",
|
||||||
|
label: "Volume",
|
||||||
|
keys: Keys::Icons(Control::Volume),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Everywhere",
|
||||||
|
label: "Mute",
|
||||||
|
keys: Keys::Icons(Control::Mute),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Everywhere",
|
||||||
|
label: "Now playing",
|
||||||
|
keys: Keys::Icons(Control::NowPlaying),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Everywhere",
|
||||||
|
label: "Search",
|
||||||
|
keys: Keys::Icons(Control::Search),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Browsing",
|
||||||
|
label: "Sections",
|
||||||
|
keys: Keys::Icons(Control::Sections),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Browsing",
|
||||||
|
label: "Add to queue",
|
||||||
|
keys: Keys::Icons(Control::Queue),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Browsing",
|
||||||
|
label: "Shuffle play",
|
||||||
|
keys: Keys::Icons(Control::ShufflePlay),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Now playing",
|
||||||
|
label: "Seek",
|
||||||
|
keys: Keys::Icons(Control::Seek),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Now playing",
|
||||||
|
label: "Shuffle mode",
|
||||||
|
keys: Keys::Icons(Control::Shuffle),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Text fields",
|
||||||
|
label: "Steam keyboard",
|
||||||
|
keys: Keys::Icons(Control::OnScreenKeyboard),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Window",
|
||||||
|
label: "Fullscreen",
|
||||||
|
keys: Keys::Text("F11", ""),
|
||||||
|
},
|
||||||
|
ControlRow {
|
||||||
|
group: "Window",
|
||||||
|
label: "Quit",
|
||||||
|
keys: Keys::Text("Ctrl + Q", ""),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
/// What the server prompt in Settings offers.
|
/// What the server prompt in Settings offers.
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
enum Choice {
|
enum Choice {
|
||||||
@@ -212,6 +328,8 @@ struct HeaderInfo {
|
|||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
enum Source {
|
enum Source {
|
||||||
Section(Section),
|
Section(Section),
|
||||||
|
/// The Controls page, opened from Settings.
|
||||||
|
Controls,
|
||||||
Album(String),
|
Album(String),
|
||||||
Artist(String),
|
Artist(String),
|
||||||
Playlist(String),
|
Playlist(String),
|
||||||
@@ -999,6 +1117,13 @@ impl App {
|
|||||||
if prompts != self.prompts {
|
if prompts != self.prompts {
|
||||||
self.prompts = prompts;
|
self.prompts = prompts;
|
||||||
self.render_hints();
|
self.render_hints();
|
||||||
|
// Its rows show the buttons of the input in use.
|
||||||
|
if self
|
||||||
|
.current_page()
|
||||||
|
.is_some_and(|p| matches!(p.source, Source::Controls))
|
||||||
|
{
|
||||||
|
self.sync_items(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1406,6 +1531,7 @@ impl App {
|
|||||||
}
|
}
|
||||||
Target::ShuffleAll => self.start_library_shuffle(),
|
Target::ShuffleAll => self.start_library_shuffle(),
|
||||||
Target::Setting(s) => self.toggle_setting(s),
|
Target::Setting(s) => self.toggle_setting(s),
|
||||||
|
Target::ControlRow(_) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1434,12 +1560,22 @@ impl App {
|
|||||||
Setting::ShowHintBar => self.settings.show_hint_bar = !self.settings.show_hint_bar,
|
Setting::ShowHintBar => self.settings.show_hint_bar = !self.settings.show_hint_bar,
|
||||||
Setting::Server(i) => return self.select_server(i),
|
Setting::Server(i) => return self.select_server(i),
|
||||||
Setting::AddServer => return self.add_server(),
|
Setting::AddServer => return self.add_server(),
|
||||||
|
Setting::Controls => return self.open_controls(),
|
||||||
// A range: left and right change it, confirm does nothing.
|
// A range: left and right change it, confirm does nothing.
|
||||||
Setting::CoverBackdrop | Setting::Version => return,
|
Setting::CoverBackdrop | Setting::Version => return,
|
||||||
}
|
}
|
||||||
self.settings_changed();
|
self.settings_changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The Controls page, on top of Settings. No header: it is a list.
|
||||||
|
fn open_controls(&mut self) {
|
||||||
|
let page = self.new_page(Source::Controls, "Controls".to_string(), true, None);
|
||||||
|
let id = page.id;
|
||||||
|
self.stacks[self.section].push(page);
|
||||||
|
self.load(id, Source::Controls);
|
||||||
|
self.render_page();
|
||||||
|
}
|
||||||
|
|
||||||
/// Moves a range setting one step up or down.
|
/// Moves a range setting one step up or down.
|
||||||
fn adjust_setting(&mut self, setting: Setting, up: bool) {
|
fn adjust_setting(&mut self, setting: Setting, up: bool) {
|
||||||
match setting {
|
match setting {
|
||||||
@@ -1454,7 +1590,8 @@ impl App {
|
|||||||
| Setting::ShowHintBar
|
| Setting::ShowHintBar
|
||||||
| Setting::Version
|
| Setting::Version
|
||||||
| Setting::Server(_)
|
| Setting::Server(_)
|
||||||
| Setting::AddServer => return,
|
| Setting::AddServer
|
||||||
|
| Setting::Controls => return,
|
||||||
}
|
}
|
||||||
self.settings_changed();
|
self.settings_changed();
|
||||||
}
|
}
|
||||||
@@ -1660,6 +1797,10 @@ impl App {
|
|||||||
self.page_loaded(page_id, Ok(data), true);
|
self.page_loaded(page_id, Ok(data), true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if matches!(source, Source::Controls) {
|
||||||
|
self.page_loaded(page_id, Ok(controls_data()), true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
let Some(client) = self.client.clone() else { return };
|
let Some(client) = self.client.clone() else { return };
|
||||||
match source {
|
match source {
|
||||||
Source::Section(Section::Recent) => self.spawn(
|
Source::Section(Section::Recent) => self.spawn(
|
||||||
@@ -1713,7 +1854,7 @@ impl App {
|
|||||||
async move { Ok(playlists_data(client.playlists().await?)) },
|
async move { Ok(playlists_data(client.playlists().await?)) },
|
||||||
move |app, r| app.page_loaded(page_id, r, true),
|
move |app, r| app.page_loaded(page_id, r, true),
|
||||||
),
|
),
|
||||||
Source::Section(Section::Search | Section::Settings) => {}
|
Source::Section(Section::Search | Section::Settings) | Source::Controls => {}
|
||||||
Source::Search(q) => self.spawn(
|
Source::Search(q) => self.spawn(
|
||||||
async move { Ok(search_data(client.search(&q).await?)) },
|
async move { Ok(search_data(client.search(&q).await?)) },
|
||||||
move |app, r| app.page_loaded(page_id, r, true),
|
move |app, r| app.page_loaded(page_id, r, true),
|
||||||
@@ -2012,13 +2153,17 @@ impl App {
|
|||||||
Target::Setting(Setting::CoverBackdrop) => Some(self.settings.cover_backdrop as f32 / 100.0),
|
Target::Setting(Setting::CoverBackdrop) => Some(self.settings.cover_backdrop as f32 / 100.0),
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
|
let (icons, detail) = match entry.target {
|
||||||
|
Target::ControlRow(i) => self.control_keys(&CONTROL_ROWS[i]),
|
||||||
|
_ => (Vec::new(), entry.detail),
|
||||||
|
};
|
||||||
Some(Item {
|
Some(Item {
|
||||||
index: index as i32,
|
index: index as i32,
|
||||||
letter: initial(&entry.title).into(),
|
letter: initial(&entry.title).into(),
|
||||||
tint: tint(&entry.title),
|
tint: tint(&entry.title),
|
||||||
title: entry.title.into(),
|
title: entry.title.into(),
|
||||||
subtitle: entry.subtitle.into(),
|
subtitle: entry.subtitle.into(),
|
||||||
detail: entry.detail.into(),
|
detail: detail.into(),
|
||||||
number: entry.number.into(),
|
number: entry.number.into(),
|
||||||
has_cover: cover.is_some(),
|
has_cover: cover.is_some(),
|
||||||
cover: cover.unwrap_or_default(),
|
cover: cover.unwrap_or_default(),
|
||||||
@@ -2027,9 +2172,26 @@ impl App {
|
|||||||
playing,
|
playing,
|
||||||
slider: level.is_some(),
|
slider: level.is_some(),
|
||||||
level: level.unwrap_or_default(),
|
level: level.unwrap_or_default(),
|
||||||
|
icons: ModelRc::new(VecModel::from(icons)),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A Controls row's icons for the input in use, or its keys written out,
|
||||||
|
/// or which input it needs when this one has nothing for it.
|
||||||
|
fn control_keys(&self, row: &ControlRow) -> (Vec<Image>, String) {
|
||||||
|
let keyboard = self.prompts == Prompts::Keyboard;
|
||||||
|
let (icons, text) = match row.keys {
|
||||||
|
Keys::Icons(c) => (self.hint_icons(c), ""),
|
||||||
|
Keys::Text(k, p) => (Vec::new(), if keyboard { k } else { p }),
|
||||||
|
};
|
||||||
|
let text = match text {
|
||||||
|
"" if icons.is_empty() && keyboard => "Controller only",
|
||||||
|
"" if icons.is_empty() => "Keyboard only",
|
||||||
|
t => t,
|
||||||
|
};
|
||||||
|
(icons, text.to_string())
|
||||||
|
}
|
||||||
|
|
||||||
fn render_shuffle(&self) {
|
fn render_shuffle(&self) {
|
||||||
let label = match self.shuffle {
|
let label = match self.shuffle {
|
||||||
_ if self.library.is_some() => "Shuffling the whole library",
|
_ if self.library.is_some() => "Shuffling the whole library",
|
||||||
@@ -2078,15 +2240,12 @@ impl App {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Screen::Browse => match self.area {
|
Screen::Browse => match self.area {
|
||||||
Area::Sidebar => {
|
// What works the same everywhere (Back, Play / Pause,
|
||||||
h(Control::Activate, "Open");
|
// Sections, Now playing, Search, and Activate where it opens)
|
||||||
h(Control::PlayPause, "Play / Pause");
|
// is on the Controls page in Settings instead.
|
||||||
h(Control::Search, "Search");
|
Area::Sidebar => {}
|
||||||
h(Control::NowPlaying, "Now playing");
|
|
||||||
}
|
|
||||||
Area::Search => {
|
Area::Search => {
|
||||||
h(Control::Activate, "Search");
|
h(Control::Activate, "Search");
|
||||||
h(Control::Back, "Back");
|
|
||||||
h(Control::OnScreenKeyboard, "Keyboard");
|
h(Control::OnScreenKeyboard, "Keyboard");
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
@@ -2111,14 +2270,14 @@ impl App {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(Target::Setting(Setting::AddServer)) => h(Control::Activate, "Add"),
|
Some(Target::Setting(Setting::AddServer)) => h(Control::Activate, "Add"),
|
||||||
|
Some(Target::Setting(Setting::Controls)) => {}
|
||||||
Some(Target::Setting(_)) => h(Control::Activate, "Change"),
|
Some(Target::Setting(_)) => h(Control::Activate, "Change"),
|
||||||
Some(_) => h(Control::Activate, "Open"),
|
Some(_) => {}
|
||||||
None if self.current_page().is_some_and(|p| p.error.is_some()) => {
|
None if self.current_page().is_some_and(|p| p.error.is_some()) => {
|
||||||
h(Control::Activate, "Try again")
|
h(Control::Activate, "Try again")
|
||||||
}
|
}
|
||||||
None => {}
|
None => {}
|
||||||
}
|
}
|
||||||
h(Control::Back, "Back");
|
|
||||||
if matches!(target, Some(Target::Song(_) | Target::Album(_) | Target::Playlist(_))) {
|
if matches!(target, Some(Target::Song(_) | Target::Album(_) | Target::Playlist(_))) {
|
||||||
h(Control::Queue, "Add to queue");
|
h(Control::Queue, "Add to queue");
|
||||||
}
|
}
|
||||||
@@ -2134,16 +2293,10 @@ impl App {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
h(Control::PlayPause, "Play / Pause");
|
|
||||||
h(Control::Sections, "Sections");
|
|
||||||
h(Control::NowPlaying, "Now playing");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Screen::NowPlaying => {
|
Screen::NowPlaying => {
|
||||||
h(Control::Activate, "Play selected");
|
h(Control::Activate, "Play selected");
|
||||||
h(Control::Back, "Back");
|
|
||||||
h(Control::PlayPause, "Play / Pause");
|
|
||||||
h(Control::Skip, "Skip");
|
|
||||||
h(
|
h(
|
||||||
Control::Shuffle,
|
Control::Shuffle,
|
||||||
match self.shuffle {
|
match self.shuffle {
|
||||||
@@ -2153,9 +2306,6 @@ impl App {
|
|||||||
Mode::Albums => "Shuffle: albums",
|
Mode::Albums => "Shuffle: albums",
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
h(Control::Seek, "Seek");
|
|
||||||
h(Control::Volume, "Volume");
|
|
||||||
h(Control::Mute, "Mute");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.ui.set_hints(ModelRc::new(VecModel::from(hints)));
|
self.ui.set_hints(ModelRc::new(VecModel::from(hints)));
|
||||||
@@ -2462,7 +2612,7 @@ impl App {
|
|||||||
Ok(songs) => app.shuffle_play(songs),
|
Ok(songs) => app.shuffle_play(songs),
|
||||||
Err(e) => failed(app, e),
|
Err(e) => failed(app, e),
|
||||||
}),
|
}),
|
||||||
Target::ShuffleAll | Target::Setting(_) => {}
|
Target::ShuffleAll | Target::Setting(_) | Target::ControlRow(_) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2510,7 +2660,7 @@ impl App {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
Target::Artist(_) => self.toast("Open the artist to queue one of their albums".into()),
|
Target::Artist(_) => self.toast("Open the artist to queue one of their albums".into()),
|
||||||
Target::ShuffleAll | Target::Setting(_) => {}
|
Target::ShuffleAll | Target::Setting(_) | Target::ControlRow(_) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3139,6 +3289,7 @@ impl App {
|
|||||||
playing: Some(index) == self.current,
|
playing: Some(index) == self.current,
|
||||||
slider: false,
|
slider: false,
|
||||||
level: 0.0,
|
level: 0.0,
|
||||||
|
icons: ModelRc::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3297,6 +3448,16 @@ fn settings_data(s: &Settings, logins: &Logins) -> PageData {
|
|||||||
show_art: false,
|
show_art: false,
|
||||||
target: Target::Setting(Setting::ShowHintBar),
|
target: Target::Setting(Setting::ShowHintBar),
|
||||||
},
|
},
|
||||||
|
Entry {
|
||||||
|
title: "Controls".to_string(),
|
||||||
|
subtitle: "Every button and key, for the controller in use or the keyboard".to_string(),
|
||||||
|
detail: String::new(),
|
||||||
|
number: String::new(),
|
||||||
|
cover: None,
|
||||||
|
round: false,
|
||||||
|
show_art: false,
|
||||||
|
target: Target::Setting(Setting::Controls),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
@@ -3318,6 +3479,31 @@ fn settings_data(s: &Settings, logins: &Logins) -> PageData {
|
|||||||
data
|
data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn controls_data() -> PageData {
|
||||||
|
PageData {
|
||||||
|
entries: CONTROL_ROWS
|
||||||
|
.iter()
|
||||||
|
.enumerate()
|
||||||
|
.map(|(i, row)| Entry {
|
||||||
|
title: row.label.to_string(),
|
||||||
|
// The one control that is a long press on a controller.
|
||||||
|
subtitle: if row.keys == Keys::Icons(Control::ShufflePlay) {
|
||||||
|
format!("{}, hold on a controller", row.group)
|
||||||
|
} else {
|
||||||
|
row.group.to_string()
|
||||||
|
},
|
||||||
|
detail: String::new(),
|
||||||
|
number: String::new(),
|
||||||
|
cover: None,
|
||||||
|
round: false,
|
||||||
|
show_art: false,
|
||||||
|
target: Target::ControlRow(i),
|
||||||
|
})
|
||||||
|
.collect(),
|
||||||
|
..Default::default()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// One step of the volume, kept within 0 to 100.
|
/// One step of the volume, kept within 0 to 100.
|
||||||
fn step_volume(v: u8, up: bool) -> u8 {
|
fn step_volume(v: u8, up: bool) -> u8 {
|
||||||
let v = v.min(100);
|
let v = v.min(100);
|
||||||
@@ -3606,6 +3792,24 @@ mod tests {
|
|||||||
assert!(has_version(false));
|
assert!(has_version(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn the_controls_page_lists_every_control_in_groups() {
|
||||||
|
for control in Control::ALL {
|
||||||
|
assert!(
|
||||||
|
CONTROL_ROWS.iter().any(|r| r.keys == Keys::Icons(control)),
|
||||||
|
"{control:?} is missing"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// Each group in one run, so the page reads as groups.
|
||||||
|
let mut seen: Vec<&str> = Vec::new();
|
||||||
|
for row in CONTROL_ROWS {
|
||||||
|
if seen.last() != Some(&row.group) {
|
||||||
|
assert!(!seen.contains(&row.group), "{} is split", row.group);
|
||||||
|
seen.push(row.group);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn volume_steps_stay_in_range() {
|
fn volume_steps_stay_in_range() {
|
||||||
assert_eq!(step_volume(50, true), 55);
|
assert_eq!(step_volume(50, true), 55);
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ mod subsonic;
|
|||||||
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
|
/// The Flatpak app id, which is also the name of the desktop file.
|
||||||
|
const APP_ID: &str = "me.anshorei.Fettleshed.Remus";
|
||||||
|
|
||||||
fn main() -> anyhow::Result<()> {
|
fn main() -> anyhow::Result<()> {
|
||||||
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("remus=info")).init();
|
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("remus=info")).init();
|
||||||
|
|
||||||
@@ -27,6 +30,10 @@ fn main() -> anyhow::Result<()> {
|
|||||||
.build()?;
|
.build()?;
|
||||||
|
|
||||||
let ui = AppWindow::new()?;
|
let ui = AppWindow::new()?;
|
||||||
|
// Docks match the window to the desktop file by this id, on Wayland as
|
||||||
|
// the app id and on X11 as the WM_CLASS. It needs the platform that
|
||||||
|
// AppWindow::new sets up, and has to be set before the window is shown.
|
||||||
|
slint::set_xdg_app_id(APP_ID)?;
|
||||||
ui.set_version(env!("CARGO_PKG_VERSION").into());
|
ui.set_version(env!("CARGO_PKG_VERSION").into());
|
||||||
app::install(&ui, rt.handle().clone());
|
app::install(&ui, rt.handle().clone());
|
||||||
// The controller is read from the device, whichever window is in front, so
|
// The controller is read from the device, whichever window is in front, so
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ export struct Item {
|
|||||||
// A setting with a range: draws `level` (0 to 1) as a slider before `detail`.
|
// A setting with a range: draws `level` (0 to 1) as a slider before `detail`.
|
||||||
slider: bool,
|
slider: bool,
|
||||||
level: float,
|
level: float,
|
||||||
|
// Button or key icons after `detail`, on the Controls page.
|
||||||
|
icons: [image],
|
||||||
}
|
}
|
||||||
|
|
||||||
export struct Header {
|
export struct Header {
|
||||||
@@ -280,6 +282,19 @@ component Row inherits Rectangle {
|
|||||||
horizontal-alignment: right;
|
horizontal-alignment: right;
|
||||||
vertical-alignment: center;
|
vertical-alignment: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if root.item.icons.length > 0: HorizontalLayout {
|
||||||
|
spacing: 4px * Theme.s;
|
||||||
|
for icon in root.item.icons: VerticalLayout {
|
||||||
|
alignment: center;
|
||||||
|
Image {
|
||||||
|
source: icon;
|
||||||
|
height: 34px * Theme.s;
|
||||||
|
// Keys such as Space are wider than a button.
|
||||||
|
width: self.height * icon.width / max(1, icon.height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TouchArea {
|
TouchArea {
|
||||||
|
|||||||
Reference in New Issue
Block a user