Version bump. Add early-error display

This commit is contained in:
Luke D. Jones
2022-08-02 15:09:25 +12:00
parent 3e244d7d3d
commit e05d5bd143
11 changed files with 84 additions and 21 deletions

View File

@@ -0,0 +1,36 @@
use egui::{Button, RichText};
pub struct AppErrorShow {
error: String,
}
impl AppErrorShow {
pub fn new(error: String) -> Self {
Self { error }
}
}
impl eframe::App for AppErrorShow {
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("ROG ERROR");
ui.centered_and_justified(|ui| {
ui.label(RichText::new(format!("The error was: {:?}", self.error)).size(22.0));
});
egui::TopBottomPanel::bottom("error_bar_2")
.default_height(26.0)
.show(ctx, |ui| {
ui.with_layout(egui::Layout::right_to_left(egui::Align::TOP), |ui| {
if ui
.add(Button::new(RichText::new("Okay").size(20.0)))
.clicked()
{
frame.quit();
}
});
});
});
}
}