From 5c71c384510c4a8570fb9ac0cc58950656c7aed6 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Wed, 3 Jan 2024 11:24:13 +0000 Subject: [PATCH] Prevent content shifts on media player by duration --- shalom/src/widgets/media_player.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/shalom/src/widgets/media_player.rs b/shalom/src/widgets/media_player.rs index 3a34173..f11189f 100644 --- a/shalom/src/widgets/media_player.rs +++ b/shalom/src/widgets/media_player.rs @@ -227,17 +227,20 @@ impl Component for MediaPlayer { row![ text(format_time(position)) .style(Text::Color(SLATE_400)) - .size(12), + .size(12) + .width(Length::FillPortion(10)), slider( 0.0..=self.device.media_duration.unwrap_or_default().as_secs_f64(), position.as_secs_f64(), Event::PositionChange ) .on_release(Event::OnPositionRelease) - .style(Slider::Custom(Box::new(SliderStyle))), + .style(Slider::Custom(Box::new(SliderStyle))) + .width(Length::FillPortion(80)), text(format_time(self.device.media_duration.unwrap_or_default())) .style(Text::Color(SLATE_400)) - .size(12), + .size(12) + .width(Length::FillPortion(10)), ] .spacing(14) .align_items(Alignment::Center), -- libgit2 1.7.2