Skip to content

Commit

Permalink
Improve image view demo
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Sep 15, 2023
1 parent 9cb6852 commit ea30deb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions crates/egui_demo_app/src/apps/image_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,17 @@ impl eframe::App for ImageViewer {

// bg_fill
ui.add_space(2.0);
ui.label("Background color");
ui.color_edit_button_srgba(&mut self.image_options.bg_fill);
ui.horizontal(|ui| {
ui.color_edit_button_srgba(&mut self.image_options.bg_fill);
ui.label("Background color");
});

// tint
ui.add_space(2.0);
ui.label("Tint");
ui.color_edit_button_srgba(&mut self.image_options.tint);
ui.horizontal(|ui| {
ui.color_edit_button_srgba(&mut self.image_options.tint);
ui.label("Tint");
});

// fit
ui.add_space(10.0);
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_demo_app/src/wrap_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl WrapApp {
),
#[cfg(feature = "image_viewer")]
(
"🖼 Image Viewer",
"🖼 Image Viewer",
Anchor::ImageViewer,
&mut self.state.image_viewer as &mut dyn eframe::App,
),
Expand Down

0 comments on commit ea30deb

Please sign in to comment.