diff --git a/src/main.rs b/src/main.rs index 2866ca7..8ac0505 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ use std::{env, ffi::OsStr, fs}; use iced::{ - Color, Element, Renderer, Subscription, Task, Theme, color, event, + Color, Element, Length, Renderer, Subscription, Task, Theme, color, event, keyboard::{self, Key, key}, theme, widget, window, }; @@ -52,7 +52,10 @@ impl State { } fn view(&self) -> Element<'_, Message, Theme, Renderer> { if let Some(allocation) = self.image_display.as_ref() { - widget::image(allocation.handle()).expand(true).into() + widget::image::viewer(allocation.handle().clone()) + .width(Length::Fill) + .height(Length::Fill) + .into() } else { widget::space().into() }