main: fix input() lifetime

This commit is contained in:
hinto.janai 2023-12-26 12:02:45 -05:00
parent 86c6b9791c
commit 3d3941081e
No known key found for this signature in database
GPG key ID: D47CE05FA175A499

View file

@ -1178,7 +1178,7 @@ fn main() {
// Run Gupax. // Run Gupax.
info!("/*************************************/ Init ... OK /*************************************/"); info!("/*************************************/ Init ... OK /*************************************/");
eframe::run_native(&app.name_version.clone(), options, Box::new(|cc| Box::new(App::cc(cc, resolution, app))),); eframe::run_native(&app.name_version.clone(), options, Box::new(move |cc| Box::new(App::cc(cc, resolution, app))),);
} }
impl eframe::App for App { impl eframe::App for App {
@ -1247,8 +1247,7 @@ impl eframe::App for App {
let wants_input = ctx.wants_keyboard_input(); let wants_input = ctx.wants_keyboard_input();
if key.is_f11() { if key.is_f11() {
let info = ctx.input(|i| i.viewport()); if ctx.input(|i| i.viewport().maximized == Some(true)) {
if info.maximized == Some(true) {
ctx.send_viewport_cmd(egui::ViewportCommand::Fullscreen(true)); ctx.send_viewport_cmd(egui::ViewportCommand::Fullscreen(true));
} }
// Change Tabs LEFT // Change Tabs LEFT