Adjust thumbnail size, allow zoom in preview

This commit is contained in:
Jeremy Soller 2024-02-22 21:24:16 -07:00
parent 9905af8f6f
commit 752e29e281
No known key found for this signature in database
GPG key ID: D02FD439211AF56F

View file

@ -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) => {