Settings, took care of warnings

This commit is contained in:
2024-11-15 12:33:11 +02:00
parent 14ee1e69bc
commit a060161c64
26 changed files with 323 additions and 126 deletions

View File

@@ -1,8 +1,9 @@
use std::{collections::{HashMap, HashSet}, ops::Deref, sync::{Arc, Mutex}};
use std::{collections::{HashMap, HashSet}, sync::{Arc, Mutex}};
use egui::{ViewportBuilder, ViewportId};
use crate::GuiState;
mod error;
mod settings;
lazy_static::lazy_static!(
static ref WINDOWS: Arc<Mutex<HashMap<WindowId, Box<dyn Window>>>> = Arc::new(Mutex::new(HashMap::new()));
@@ -16,6 +17,7 @@ pub trait Window: std::fmt::Debug + Send {
#[derive(Debug, Clone, Hash, PartialEq, PartialOrd, Ord, Eq)]
pub enum WindowId {
Settings,
Error
}
@@ -49,7 +51,6 @@ impl Windows {
if self.is_open(&win_id) {
ctx.show_viewport_immediate(vp_id.clone(), builder.clone(), |ctx, _vp_class| {
ctx.input(|inp| {
// println!("CLose requested: {}",inp.viewport().close_requested() );
self.toggle(win_id, !inp.viewport().close_requested());
});
egui::CentralPanel::default().show(ctx, |ui| {