Toggle fullscreen in egui_demo_app with F11
This commit is contained in:
parent
a925511032
commit
a70b173333
2 changed files with 15 additions and 3 deletions
|
@ -172,10 +172,14 @@ impl BackendPanel {
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
{
|
{
|
||||||
let mut fullscreen = frame.info().window_info.fullscreen;
|
let mut fullscreen = frame.info().window_info.fullscreen;
|
||||||
ui.checkbox(&mut fullscreen, "🗖 Fullscreen")
|
if ui
|
||||||
.on_hover_text("Fullscreen the window");
|
.checkbox(&mut fullscreen, "🗖 Fullscreen (F11)")
|
||||||
|
.on_hover_text("Fullscreen the window")
|
||||||
|
.changed()
|
||||||
|
{
|
||||||
frame.set_fullscreen(fullscreen);
|
frame.set_fullscreen(fullscreen);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ui
|
if ui
|
||||||
.button("📱 Phone Size")
|
.button("📱 Phone Size")
|
||||||
|
|
|
@ -190,6 +190,14 @@ impl eframe::App for WrapApp {
|
||||||
self.state.selected_anchor = selected_anchor;
|
self.state.selected_anchor = selected_anchor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
if ctx
|
||||||
|
.input_mut()
|
||||||
|
.consume_key(egui::Modifiers::NONE, egui::Key::F11)
|
||||||
|
{
|
||||||
|
frame.set_fullscreen(!frame.info().window_info.fullscreen);
|
||||||
|
}
|
||||||
|
|
||||||
egui::TopBottomPanel::top("wrap_app_top_bar").show(ctx, |ui| {
|
egui::TopBottomPanel::top("wrap_app_top_bar").show(ctx, |ui| {
|
||||||
egui::trace!(ui);
|
egui::trace!(ui);
|
||||||
ui.horizontal_wrapped(|ui| {
|
ui.horizontal_wrapped(|ui| {
|
||||||
|
|
Loading…
Reference in a new issue