use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize)] pub struct WindowConfig { pub url: String, pub hide_title_bar: bool, pub fullscreen: bool, pub width: f64, pub height: f64, pub resizable: bool, pub url_type: String, pub always_on_top: bool, pub disabled_web_shortcuts: bool, pub activation_shortcut: String, } #[derive(Debug, Serialize, Deserialize)] pub struct PlatformSpecific { pub macos: T, pub linux: T, pub windows: T, } impl PlatformSpecific { pub const fn get(&self) -> &T { #[cfg(target_os = "macos")] let platform = &self.macos; #[cfg(target_os = "linux")] let platform = &self.linux; #[cfg(target_os = "windows")] let platform = &self.windows; platform } } impl PlatformSpecific where T: Copy, { pub const fn copied(&self) -> T { *self.get() } } pub type UserAgent = PlatformSpecific; pub type FunctionON = PlatformSpecific; #[derive(Debug, Serialize, Deserialize)] pub struct PakeConfig { pub windows: Vec, pub user_agent: UserAgent, pub system_tray: FunctionON, } impl PakeConfig { pub fn show_system_tray(&self) -> bool { self.system_tray.copied() } }