1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 07:23:13 -04:00

Double-click titlebar to toggle maximized state

This commit is contained in:
Emil Ernerfeldt
2023-02-04 14:32:07 +01:00
parent 1cb9d954d1
commit 9c98962357

View File

@@ -95,7 +95,11 @@ fn custom_window_frame(
};
let title_bar_response =
ui.interact(title_bar_rect, Id::new("title_bar"), Sense::click());
if title_bar_response.is_pointer_button_down_on() {
if title_bar_response.double_clicked() {
app.maximized = !app.maximized;
frame.set_maximized(app.maximized);
} else if title_bar_response.is_pointer_button_down_on() {
frame.drag_window();
}