Double-click titlebar to toggle maximized state
This commit is contained in:
parent
1cb9d954d1
commit
9c98962357
1 changed files with 5 additions and 1 deletions
|
@ -95,7 +95,11 @@ fn custom_window_frame(
|
||||||
};
|
};
|
||||||
let title_bar_response =
|
let title_bar_response =
|
||||||
ui.interact(title_bar_rect, Id::new("title_bar"), Sense::click());
|
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();
|
frame.drag_window();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue