mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Only set context on startup
This commit is contained in:
+10
-4
@@ -89,12 +89,20 @@ impl epi::App for MyEguiApp {
|
|||||||
"BoilR"
|
"BoilR"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update(&mut self, ctx: &egui::Context, _frame: &epi::Frame) {
|
fn setup(
|
||||||
|
&mut self,
|
||||||
|
ctx: &egui::Context,
|
||||||
|
_frame: &epi::Frame,
|
||||||
|
_storage: Option<&dyn epi::Storage>
|
||||||
|
) {
|
||||||
ctx.set_pixels_per_point(1.0);
|
ctx.set_pixels_per_point(1.0);
|
||||||
let mut style: egui::Style = (*ctx.style()).clone();
|
let mut style: egui::Style = (*ctx.style()).clone();
|
||||||
create_style(&mut style);
|
create_style(&mut style);
|
||||||
ctx.set_style(style);
|
ctx.set_style(style);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn update(&mut self, ctx: &egui::Context, _frame: &epi::Frame) {
|
||||||
|
|
||||||
egui::SidePanel::new(egui::panel::Side::Left, "Side Panel")
|
egui::SidePanel::new(egui::panel::Side::Left, "Side Panel")
|
||||||
.default_width(40.0)
|
.default_width(40.0)
|
||||||
.show(ctx, |ui| {
|
.show(ctx, |ui| {
|
||||||
@@ -103,7 +111,6 @@ impl epi::App for MyEguiApp {
|
|||||||
ui.image(texture, size);
|
ui.image(texture, size);
|
||||||
ui.separator();
|
ui.separator();
|
||||||
ui.selectable_value(&mut self.selected_menu, Menues::Import, "Import Games");
|
ui.selectable_value(&mut self.selected_menu, Menues::Import, "Import Games");
|
||||||
// ui.selectable_value(&mut self.selected_menu, Menues::Art, "Art");
|
|
||||||
ui.selectable_value(&mut self.selected_menu, Menues::Settings, "Settings");
|
ui.selectable_value(&mut self.selected_menu, Menues::Settings, "Settings");
|
||||||
});
|
});
|
||||||
if self.games_to_sync.is_some(){
|
if self.games_to_sync.is_some(){
|
||||||
@@ -359,7 +366,6 @@ impl MyEguiApp{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
ui.label("Check the settings if BoilR didn't find the game you where looking for");
|
ui.label("Check the settings if BoilR didn't find the game you where looking for");
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -378,7 +384,7 @@ pub fn run_ui() -> Result<(), Box<dyn Error>> {
|
|||||||
native_options.initial_window_size = Some(egui::Vec2{
|
native_options.initial_window_size = Some(egui::Vec2{
|
||||||
x:800.,
|
x:800.,
|
||||||
y:500.
|
y:500.
|
||||||
});
|
});
|
||||||
native_options.icon_data = Some(get_logo_icon());
|
native_options.icon_data = Some(get_logo_icon());
|
||||||
eframe::run_native(Box::new(app), native_options);
|
eframe::run_native(Box::new(app), native_options);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user