Major update
too lazy to describe
This commit is contained in:
@@ -3,15 +3,15 @@ use egui::{ViewportBuilder, ViewportId};
|
||||
use crate::GuiState;
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
mod debug;
|
||||
mod error;
|
||||
mod settings;
|
||||
mod add_song;
|
||||
mod new_song;
|
||||
mod new_playlist;
|
||||
pub mod debug;
|
||||
pub mod error;
|
||||
pub mod settings;
|
||||
pub mod add_song;
|
||||
pub mod new_song;
|
||||
pub mod new_playlist;
|
||||
|
||||
lazy_static::lazy_static!(
|
||||
static ref WINDOWS: Arc<Mutex<HashMap<WindowId, Box<dyn Window>>>> = Arc::new(Mutex::new(HashMap::new()));
|
||||
pub static ref WINDOWS: Arc<Mutex<HashMap<WindowId, Box<dyn Window>>>> = Arc::new(Mutex::new(HashMap::new()));
|
||||
static ref OPEN_WINDOWS: Arc<Mutex<HashSet<WindowId>>> = Arc::new(Mutex::new(HashSet::new()));
|
||||
);
|
||||
|
||||
@@ -22,6 +22,7 @@ pub trait Window: std::fmt::Debug + Send {
|
||||
fn close(&self) where Self: Sized{
|
||||
OPEN_WINDOWS.lock().unwrap().remove(&Self::id());
|
||||
}
|
||||
fn set_value<V>(&mut self, k: String, v: Box<V>) where Self: Sized;
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Hash, PartialEq, PartialOrd, Ord, Eq)]
|
||||
@@ -104,4 +105,10 @@ impl Windows {
|
||||
pub fn is_open(&self, id: &WindowId) -> bool {
|
||||
OPEN_WINDOWS.lock().unwrap().contains(&id)
|
||||
}
|
||||
|
||||
pub fn set_value(&self, id: &WindowId, k: impl ToString, v: impl ToString) -> crate::Result<()> {
|
||||
// WINDOWS.lock().unwrap().get_mut(&win_id).unwrap().set_value();
|
||||
//
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user