Skip to content

Commit

Permalink
Merge pull request #639 from woelper/double_click_to_fullscreen
Browse files Browse the repository at this point in the history
feat: Double clicking image toggles fullscreen (closes #683)
  • Loading branch information
woelper authored Feb 11, 2025
2 parents f7aab68 + 21c9195 commit 5bbb3d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,15 @@ fn drawe(app: &mut App, gfx: &mut Graphics, plugins: &mut Plugins, state: &mut O
ctx.memory_mut(|w| w.open_popup(Id::new(&id)));
}

if !state.pointer_over_ui && !state.mouse_grab {
if ctx.input(|r| {
r.pointer
.button_double_clicked(egui::PointerButton::Primary)
}) {
toggle_fullscreen(app, state);
}
}

// set info panel color dynamically
info_panel_color = ctx.style().visuals.panel_fill;

Expand Down

0 comments on commit 5bbb3d4

Please sign in to comment.