From 752e29e2818d874d9881e88755d8540a03f40e2b Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 22 Feb 2024 21:24:16 -0700 Subject: [PATCH] Adjust thumbnail size, allow zoom in preview --- src/tab.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tab.rs b/src/tab.rs index 45348c8..0a84441 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -461,7 +461,9 @@ impl Item { column = column.push(widget::row::with_children(vec![ widget::horizontal_space(Length::Fill).into(), if is_image { - widget::image::Image::new(&self.path).into() + widget::image::viewer(widget::image::Handle::from_path(&self.path)) + .min_scale(1.0) + .into() } else { widget::icon::icon(self.icon_handle_grid.clone()) .size(sizes.grid()) @@ -1125,7 +1127,7 @@ impl Tab { Ok(reader) => match reader.decode() { Ok(image) => { //TODO: configurable thumbnail size - let thumbnail = image.thumbnail(256, 256); + let thumbnail = image.thumbnail(64, 64); Ok(thumbnail.to_rgba8()) } Err(err) => {