From 0960021ec36eb986765a1d1e47753bcb0b147de1 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Sat, 27 Jul 2024 15:59:29 +0100 Subject: [PATCH] Updated main app setup to reflect latest version boilerplate --- src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2487267..e73c1fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,8 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -mod theme; mod app; +mod theme; use app::App; +use egui::ViewportBuilder; fn main() -> Result<(), eframe::Error> { // Log to stdout (if you run with `RUST_LOG=debug`). @@ -9,8 +10,7 @@ fn main() -> Result<(), eframe::Error> { // Setup the options for the default window let options = eframe::NativeOptions { - initial_window_size: Some(egui::vec2(300.0, 200.0)), - resizable: true, + viewport: ViewportBuilder::default().with_inner_size(egui::vec2(300.0, 200.0)), ..Default::default() }; @@ -18,6 +18,6 @@ fn main() -> Result<(), eframe::Error> { eframe::run_native( "egui-template", options, - Box::new(|_cc| Box::new(App::default())), + Box::new(|_cc| Ok(Box::new(App::default()))), ) -} \ No newline at end of file +}