mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-26 21:41:48 +02:00
fix(window-state): manual default implentation (#425)
* fix(window-state): manual default implentation, closes #421 * Update lib.rs
This commit is contained in:
@@ -53,7 +53,7 @@ impl Default for StateFlags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Deserialize, Serialize, PartialEq)]
|
#[derive(Debug, Deserialize, Serialize, PartialEq)]
|
||||||
struct WindowState {
|
struct WindowState {
|
||||||
width: f64,
|
width: f64,
|
||||||
height: f64,
|
height: f64,
|
||||||
@@ -65,6 +65,21 @@ struct WindowState {
|
|||||||
fullscreen: bool,
|
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>>>);
|
struct WindowStateCache(Arc<Mutex<HashMap<String, WindowState>>>);
|
||||||
pub trait AppHandleExt {
|
pub trait AppHandleExt {
|
||||||
/// Saves all open windows state to disk
|
/// Saves all open windows state to disk
|
||||||
|
|||||||
Reference in New Issue
Block a user