mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
demo app: add buttons to toggle window decorations on/off
This commit is contained in:
@@ -134,13 +134,24 @@ impl BackendPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !frame.is_web()
|
if !frame.is_web() {
|
||||||
&& ui
|
ui.horizontal(|ui| {
|
||||||
|
ui.label("Window decorations:");
|
||||||
|
if ui.button("Show").clicked() {
|
||||||
|
frame.set_decorations(true);
|
||||||
|
}
|
||||||
|
if ui.button("Hide").clicked() {
|
||||||
|
frame.set_decorations(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if ui
|
||||||
.button("📱 Phone Size")
|
.button("📱 Phone Size")
|
||||||
.on_hover_text("Resize the window to be small like a phone.")
|
.on_hover_text("Resize the window to be small like a phone.")
|
||||||
.clicked()
|
.clicked()
|
||||||
{
|
{
|
||||||
frame.set_window_size(egui::Vec2::new(375.0, 812.0)); // iPhone 12 mini
|
frame.set_window_size(egui::Vec2::new(375.0, 812.0)); // iPhone 12 mini
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.separator();
|
ui.separator();
|
||||||
|
|||||||
Reference in New Issue
Block a user