diff --git a/Cargo.toml b/Cargo.toml index 65be725..1c756de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "egui-template" +name = "AvBag" version = "0.1.0" edition = "2021" diff --git a/README.md b/README.md index 5356532..82e1298 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# egui-template +# AvBag -Template repo for an egui application in rust \ No newline at end of file +Rust application to serve as a Aviation Flight Bag \ No newline at end of file diff --git a/src/app/mod.rs b/src/app/mod.rs index cdf8c70..a565930 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1,15 +1,21 @@ mod ui; /// Stuct to store the state of the running application -pub struct App { - name: String +pub struct App<'a> { + name: &'a str, + icao: Vec<&'a str>, + metars: Vec<&'a str>, + tafs: Vec<&'a str> } -impl Default for App { +impl <'a> Default for App<'a> { /// Creates the default startup state for the app; fn default() -> Self { Self { - name: String::from("Hello, World!") + name: "AvBag - Welcome", + icao: vec![], + metars: vec![], + tafs: vec![] } } } \ No newline at end of file diff --git a/src/app/ui/mod.rs b/src/app/ui/mod.rs index d9b386d..6f10096 100644 --- a/src/app/ui/mod.rs +++ b/src/app/ui/mod.rs @@ -1,26 +1,14 @@ use crate::app::App; use crate::theme::onedark::ONE_DARK; -impl eframe::App for App { +impl <'a>eframe::App for App<'a> { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { let background_frame = egui::Frame::default().fill(ONE_DARK.bg); egui::CentralPanel::default() .frame(background_frame) .show(ctx, |ui| { - ui.heading(&self.name); + ui.heading(self.name); }); - - egui::Window::new("test window") - .collapsible(false) - .auto_sized() - .show(ctx, |ui| { - ui.heading(&self.name); - - for _ in 0..10 { - ui.add(egui::Button::new(&self.name)); - } - } - ); } } \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index e73c1fe..ad92573 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ fn main() -> Result<(), eframe::Error> { //Start rendering and run the application eframe::run_native( - "egui-template", + "AvBag", options, Box::new(|_cc| Ok(Box::new(App::default()))), )