feat: put the bars together

this made sense now that I made error messages shorter,
and figured out how to properly align things in a row.

looks good! might even consider keeping the infobar on by default
This commit is contained in:
electria 2026-07-31 17:31:34 -07:00
commit 808a8bf31d
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs

View file

@ -50,9 +50,7 @@ impl State {
(state, Task::none())
}
fn view(&self) -> Element<'_, Message, Theme, Renderer> {
let mut main = Vec::new();
main.push(self.image_display.as_ref().map_or_else(
let main = self.image_display.as_ref().map_or_else(
|| {
widget::container(widget::text(include_str!("usage.txt")))
.height(Length::Fill)
@ -70,16 +68,27 @@ impl State {
.height(Length::Fill)
.into()
},
));
);
let mut bar = Vec::new();
if let Some(error) = self.error.as_ref() {
main.push(widget::text(error).style(widget::text::danger).into());
bar.push(
widget::container(widget::text(error).style(widget::text::danger))
.align_x(Alignment::Start)
.width(Length::Fill)
.into(),
);
}
if self.infobar_shown && self.info.is_some() {
main.push(widget::text(self.title()).into());
bar.push(
widget::container(widget::text(self.title()))
.align_x(Alignment::End)
.width(Length::Fill)
.into(),
);
}
widget::column(main).into()
widget::column([main, widget::row(bar).into()]).into()
}
fn update(&mut self, message: Message) -> Task<Message> {
match message {