More work on partition stage.

This commit is contained in:
2026-05-13 00:24:05 +02:00
parent f851c6fef0
commit 4000e0cfac
5 changed files with 182 additions and 133 deletions
+24
View File
@@ -0,0 +1,24 @@
use iced::widget::{Row, container, text};
use iced::{Alignment, Color, Element, Length};
// Assuming your Item struct or type implements Display or has a text representation
pub fn color_bar<Message: 'static>(
maybe_items: Option<Vec<(String, u16, Color)>>,
bar_height: u32,
) -> Element<'static, Message> {
let mut c_b = Row::new().height(bar_height);
if let Some(items) = maybe_items {
for (bar_text, bar_fill, bar_color) in items {
c_b = c_b.push(
container(text(bar_text).color(Color::BLACK).size(iced::Pixels(14.0)))
.height(Length::Fill)
.width(Length::FillPortion(bar_fill))
.style(move |_| container::background(bar_color))
.align_x(Alignment::Center)
.align_y(Alignment::Center),
);
}
}
c_b.into()
}