From 3e1e6b090ef4e15abb8a27fac265cbc6dd02e00e Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 4 Mar 2024 11:19:43 -0700 Subject: [PATCH] Add more info to open with context page --- src/tab.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/tab.rs b/src/tab.rs index a134d91..e3dcc6a 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -496,8 +496,30 @@ impl Item { let mut column = widget::column().spacing(space_xxxs); + column = column.push(widget::row::with_children(vec![ + widget::horizontal_space(Length::Fill).into(), + // This loads the image only if thumbnailing worked + if self + .thumbnail_res_opt + .as_ref() + .map_or(false, |res| res.is_ok()) + { + widget::image::viewer(widget::image::Handle::from_path(&self.path)) + .min_scale(1.0) + .into() + } else { + widget::icon::icon(self.icon_handle_grid.clone()) + .content_fit(ContentFit::Contain) + .size(sizes.grid()) + .into() + }, + widget::horizontal_space(Length::Fill).into(), + ])); + column = column.push(widget::text::heading(&self.name)); + column = column.push(widget::text(format!("Type: {}", self.mime))); + for app in self.open_with.iter() { column = column.push( widget::button(