From 808a8bf31d789f5af8ca505c717f5bc648bc466d Mon Sep 17 00:00:00 2001 From: electria Date: Fri, 31 Jul 2026 17:31:34 -0700 Subject: [PATCH] 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 --- src/main.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2acbbfa..b89efc0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 { match message {