fix(window-state): manual default implentation (#425)

* fix(window-state): manual default implentation, closes #421

* Update lib.rs
pull/436/head
Amr Bashir 2 years ago committed by amrbashir
parent 38e8522be5
commit 55456de5b5
No known key found for this signature in database
GPG Key ID: BBD7A47A2003FF33

@ -55,7 +55,7 @@ impl Default for StateFlags {
}
}
#[derive(Debug, Default, Deserialize, Serialize, PartialEq)]
#[derive(Debug, Deserialize, Serialize, PartialEq)]
struct WindowState {
width: f64,
height: f64,
@ -67,6 +67,21 @@ struct WindowState {
fullscreen: bool,
}
impl Default for WindowState {
fn default() -> Self {
Self {
width: Default::default(),
height: Default::default(),
x: Default::default(),
y: Default::default(),
maximized: Default::default(),
visible: true,
decorated: true,
fullscreen: Default::default(),
}
}
}
struct WindowStateCache(Arc<Mutex<HashMap<String, WindowState>>>);
pub trait AppHandleExt {
/// Saves all open windows state to disk

Loading…
Cancel
Save