generated from PlexSheep/rs-base
feat(info): add info diag
cargo devel CI / cargo CI (push) Has been cancelled
Details
cargo devel CI / cargo CI (push) Has been cancelled
Details
This commit is contained in:
parent
8f51a5ff44
commit
abe8f25c68
|
@ -25,3 +25,4 @@ libpt = { version = "0.6.0", features = ["cli"] }
|
||||||
clap = { version = "4.5.15", features = ["derive"] }
|
clap = { version = "4.5.15", features = ["derive"] }
|
||||||
image = "0.25.2"
|
image = "0.25.2"
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
|
rfd = "0.14.1"
|
||||||
|
|
16
src/app.rs
16
src/app.rs
|
@ -1,6 +1,7 @@
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use egui::IconData;
|
use egui::IconData;
|
||||||
use libpt::cli::args::{VerbosityLevel, HELP_TEMPLATE};
|
use libpt::cli::args::{VerbosityLevel, HELP_TEMPLATE};
|
||||||
|
use libpt::log::{debug, info};
|
||||||
|
|
||||||
pub const TITLE: &str = "Rollator";
|
pub const TITLE: &str = "Rollator";
|
||||||
|
|
||||||
|
@ -54,6 +55,15 @@ impl RollatorApp {
|
||||||
pub fn new_with_cli() -> Self {
|
pub fn new_with_cli() -> Self {
|
||||||
Self::parse()
|
Self::parse()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn info_diag(&mut self) {
|
||||||
|
debug!("opening info dialogue");
|
||||||
|
rfd::MessageDialog::new()
|
||||||
|
.set_level(rfd::MessageLevel::Info)
|
||||||
|
.set_title(format!("{TITLE}: Information"))
|
||||||
|
.set_description("idk what to put here, its just some links and info")
|
||||||
|
.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl eframe::App for RollatorApp {
|
impl eframe::App for RollatorApp {
|
||||||
|
@ -78,10 +88,8 @@ impl eframe::App for RollatorApp {
|
||||||
if ui.button("Quit").clicked() {
|
if ui.button("Quit").clicked() {
|
||||||
ctx.send_viewport_cmd(egui::ViewportCommand::Close);
|
ctx.send_viewport_cmd(egui::ViewportCommand::Close);
|
||||||
}
|
}
|
||||||
});
|
if ui.button("Info").clicked() {
|
||||||
ui.menu_button("AAAA", |ui| {
|
self.info_diag();
|
||||||
if ui.button("Quit").clicked() {
|
|
||||||
ctx.send_viewport_cmd(egui::ViewportCommand::Close);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ui.add_space(16.0);
|
ui.add_space(16.0);
|
||||||
|
|
Loading…
Reference in New Issue