Work on Partition Stage, added custom swap size selection.
This commit is contained in:
+13
-6
@@ -1,4 +1,4 @@
|
||||
use iced::widget::{Row, container, text};
|
||||
use iced::widget::{self, Row, container, text};
|
||||
use iced::{Alignment, Color, Element, Length};
|
||||
|
||||
// Assuming your Item struct or type implements Display or has a text representation
|
||||
@@ -6,10 +6,9 @@ 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 {
|
||||
|
||||
let mut c_b = Row::new().height(Length::Fill);
|
||||
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)))
|
||||
@@ -21,9 +20,17 @@ pub fn color_bar<Message: 'static>(
|
||||
.padding(2),
|
||||
);
|
||||
}
|
||||
}
|
||||
container(c_b.spacing(2))
|
||||
container(c_b.spacing(2))
|
||||
.style(container::rounded_box)
|
||||
.padding(3)
|
||||
.height(bar_height)
|
||||
.into()
|
||||
}
|
||||
else {
|
||||
widget::container(widget::space())
|
||||
.height(bar_height)
|
||||
.width(Length::Fill)
|
||||
.into()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user