Add more info to open with context page

This commit is contained in:
Jeremy Soller 2024-03-04 11:19:43 -07:00
parent 672821a5fc
commit 3e1e6b090e
No known key found for this signature in database
GPG key ID: D02FD439211AF56F

View file

@ -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(