From 570f35fcda39f5b17051ea48158088f6a42cbfc5 Mon Sep 17 00:00:00 2001 From: Peter Krull Date: Sat, 3 Aug 2024 01:39:04 +0200 Subject: [PATCH] Adjusted to 52px-tall valued OSD container, 4px progress bar --- src/components/osd_indicator.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/osd_indicator.rs b/src/components/osd_indicator.rs index fda55ad..30cd0e3 100644 --- a/src/components/osd_indicator.rs +++ b/src/components/osd_indicator.rs @@ -155,25 +155,25 @@ impl State { let osd_contents = if let Some(value) = self.params.value() { radius = cosmic::theme::active().cosmic().radius_l(); const OSD_WIDTH: f32 = 392.0; - const OSD_HEIGHT: f32 = 64.0; - const FLANK_WIDTH: f32 = 40.0; + const OSD_HEIGHT: f32 = 52.0; + const FLANK_WIDTH: f32 = 36.0; const SPACING: f32 = 12.0; - const BAR_WIDTH: f32 = OSD_WIDTH - 2.0 * FLANK_WIDTH - 6.0 * SPACING; + const BAR_WIDTH: f32 = OSD_WIDTH - 2.0 * FLANK_WIDTH - 1.15 * OSD_HEIGHT; cosmic::widget::container( widget::row![ cosmic::widget::container(icon.size(20)) .width(FLANK_WIDTH) .align_x(iced::alignment::Horizontal::Center), + cosmic::widget::horizontal_space(SPACING), cosmic::widget::progress_bar(0. ..=100., value as f32) - .height(8) + .height(4) .width(BAR_WIDTH), cosmic::widget::text(format!("{}%", value)) .size(16) - .width(FLANK_WIDTH) + .width(FLANK_WIDTH + SPACING) .horizontal_alignment(iced::alignment::Horizontal::Right), ] - .align_items(iced::Alignment::Center) - .spacing(SPACING), + .align_items(iced::Alignment::Center), ) .width(OSD_WIDTH) .height(OSD_HEIGHT)