From b5ef9fbb13dfcbdee60ec4462d404708577f8b25 Mon Sep 17 00:00:00 2001 From: Ansho Rei Date: Wed, 4 Nov 2026 19:38:26 +0100 Subject: [PATCH] fix: centre the play/pause icon and volume bar under the progress The icon was centred in the space between the two times, so it moved when their widths differed. The time row is now placed by hand: times at the edges, icon on the row's midpoint. The volume row was centred as a whole, and its number label is wider than the speaker, so the bar sat left of centre. On now playing the speaker now gets a box as wide as the label, which puts the bar in the middle. The bottom bar keeps the compact layout. --- CHANGELOG.md | 6 +++ Cargo.lock | 2 +- Cargo.toml | 2 +- .../me.anshorei.Fettleshed.Remus.metainfo.xml | 1 + ui/app.slint | 46 +++++++++++-------- 5 files changed, 36 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c4faa4..61e24a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ One section per version, newest first. +## v0.8.2 (2026-11-04) + +### Bug fixes + +- On the now-playing screen the play/pause icon and the volume bar sit exactly under the middle of the progress bar. Before, the icon moved with the widths of the two times and the volume bar sat left of centre. + ## v0.8.1 (2026-11-04) ### Features diff --git a/Cargo.lock b/Cargo.lock index 5090f98..08cfdbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4385,7 +4385,7 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "remus" -version = "0.8.1" +version = "0.8.2" dependencies = [ "anyhow", "directories", diff --git a/Cargo.toml b/Cargo.toml index a8dac5e..a720424 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "remus" -version = "0.8.1" +version = "0.8.2" edition = "2024" license = "MIT" diff --git a/flatpak/me.anshorei.Fettleshed.Remus.metainfo.xml b/flatpak/me.anshorei.Fettleshed.Remus.metainfo.xml index ffaab5a..a91e83f 100644 --- a/flatpak/me.anshorei.Fettleshed.Remus.metainfo.xml +++ b/flatpak/me.anshorei.Fettleshed.Remus.metainfo.xml @@ -20,6 +20,7 @@ + diff --git a/ui/app.slint b/ui/app.slint index 901dbfd..5a5e223 100644 --- a/ui/app.slint +++ b/ui/app.slint @@ -572,16 +572,24 @@ component VolumeLevel inherits HorizontalLayout { in property level; in property muted; in property font-size: 13px * Theme.s; + // The speaker gets a box as wide as the number, so the bar is the middle + // of the whole and centring the row centres the bar. + in property balanced; + // Fixed, so the bar does not shift as the number changes, and wide enough + // for "Muted". + property label-width: 4.2 * root.font-size; spacing: 10px * Theme.s; // Its own width only, so a stretching row does not hand it the slack. horizontal-stretch: 0; - VerticalLayout { - alignment: center; + HorizontalLayout { + width: root.balanced ? root.label-width : 14px * Theme.s; + alignment: end; Speaker { muted: root.muted || root.level == 0; tint: Theme.muted; size: 14px * Theme.s; + y: (parent.height - self.height) / 2; } } VerticalLayout { @@ -600,9 +608,7 @@ component VolumeLevel inherits HorizontalLayout { } } Text { - // Fixed, so the bar does not shift as the number changes, and wide - // enough for "Muted". - width: 4.2 * root.font-size; + width: root.label-width; text: root.muted ? "Muted" : root.level; font-size: root.font-size; color: Theme.muted; @@ -1088,35 +1094,37 @@ component NowPlayingView inherits Rectangle { background: Theme.highlight; } } - HorizontalLayout { - Text { + // Placed by hand: the icon on the bar's midpoint whatever the + // widths of the two times, which a layout would share out. + Rectangle { + height: position-text.preferred-height; + position-text := Text { + x: 0; + width: self.preferred-width; text: root.position; font-size: 14px * Theme.s; color: Theme.muted; } - // Sized below the time text, so the row keeps the text's height. - HorizontalLayout { - horizontal-stretch: 1; - alignment: center; - if root.has-track: VerticalLayout { - alignment: center; - PlayState { - paused: root.paused; - size: 11px * Theme.s; - } - } - } Text { + x: parent.width - self.width; + width: self.preferred-width; text: root.duration; font-size: 14px * Theme.s; color: Theme.muted; } + if root.has-track: PlayState { + x: (parent.width - self.width) / 2; + y: (parent.height - self.height) / 2; + paused: root.paused; + size: 11px * Theme.s; + } } HorizontalLayout { alignment: center; VolumeLevel { level: root.volume; muted: root.muted; + balanced: true; } } }