From b7b5094a1da29416a1f2858f5d22de11916fd60e Mon Sep 17 00:00:00 2001 From: Doug Lau Date: Wed, 1 Nov 2023 17:47:24 -0500 Subject: [PATCH] Problems on first start. fixes #208 - Image not visible until fit / fixed button press - Help screen shows without button highlighted --- src/main.rs | 1 + src/widgets/picture_widget.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 4be20557..4c43f052 100644 --- a/src/main.rs +++ b/src/main.rs @@ -161,6 +161,7 @@ fn main() { }); } let help_visible = Cell::new(first_launch); + bottom_bar.set_help_visible(help_visible.get()); help_screen.set_visible(help_visible.get()); { let help_screen = help_screen; diff --git a/src/widgets/picture_widget.rs b/src/widgets/picture_widget.rs index 6952e86a..0f2cd1ee 100644 --- a/src/widgets/picture_widget.rs +++ b/src/widgets/picture_widget.rs @@ -400,6 +400,7 @@ impl PictureWidgetData { pub fn set_img_size_to_orig(&mut self) { self.img_texel_size = 1.0; self.scaling = ScalingMode::Fixed; + self.config.lock().unwrap().set_scaling(self.scaling); self.update_scaling_buttons(); self.render_validity.invalidate(); } @@ -519,7 +520,7 @@ impl PictureWidget { program, bright_shade: 0.95, - img_texel_size: 0.0, + img_texel_size: 1.0, scaling, img_pos: Default::default(), antialiasing,