From ed7b61380473c7c88c25b5d4d17112b844a9364d Mon Sep 17 00:00:00 2001 From: Casper Storm Date: Thu, 23 Feb 2023 14:33:53 +0100 Subject: Added macOS platform specific options --- src/window/settings.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/window/settings.rs') diff --git a/src/window/settings.rs b/src/window/settings.rs index 24d0f4f9..a039e213 100644 --- a/src/window/settings.rs +++ b/src/window/settings.rs @@ -1,5 +1,15 @@ use crate::window::{Icon, Position}; +#[cfg(target_os = "macos")] +#[path = "settings/macos.rs"] +mod platform; + +#[cfg(not(target_os = "macos"))] +#[path = "settings/other.rs"] +mod platform; + +pub use platform::PlatformSpecific; + /// The window settings of an application. #[derive(Debug, Clone)] pub struct Settings { @@ -32,6 +42,9 @@ pub struct Settings { /// The icon of the window. pub icon: Option, + + /// Platform specific settings. + pub platform_specific: platform::PlatformSpecific, } impl Default for Settings { @@ -47,6 +60,7 @@ impl Default for Settings { transparent: false, always_on_top: false, icon: None, + platform_specific: Default::default(), } } } @@ -64,7 +78,9 @@ impl From for iced_winit::settings::Window { transparent: settings.transparent, always_on_top: settings.always_on_top, icon: settings.icon.map(Icon::into), - platform_specific: Default::default(), + platform_specific: iced_winit::settings::PlatformSpecific::from( + settings.platform_specific, + ), } } } -- cgit