diff options
author | 2023-03-14 11:22:06 +0100 | |
---|---|---|
committer | 2023-03-14 11:31:16 +0100 | |
commit | 4405a3d483286faf962930ca3b294b34f86bd2f4 (patch) | |
tree | 7620887744718bb3b93b707130dea0035d93e007 /src | |
parent | ed7b61380473c7c88c25b5d4d17112b844a9364d (diff) | |
download | iced-4405a3d483286faf962930ca3b294b34f86bd2f4.tar.gz iced-4405a3d483286faf962930ca3b294b34f86bd2f4.tar.bz2 iced-4405a3d483286faf962930ca3b294b34f86bd2f4.zip |
Re-export `settings::PlatformSpecific` from `iced_winit` directly
Diffstat (limited to 'src')
-rw-r--r-- | src/window/settings.rs | 16 | ||||
-rw-r--r-- | src/window/settings/macos.rs | 20 | ||||
-rw-r--r-- | src/window/settings/other.rs | 9 |
3 files changed, 3 insertions, 42 deletions
diff --git a/src/window/settings.rs b/src/window/settings.rs index a039e213..3c8da62f 100644 --- a/src/window/settings.rs +++ b/src/window/settings.rs @@ -1,14 +1,6 @@ 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; +pub use iced_winit::settings::PlatformSpecific; /// The window settings of an application. #[derive(Debug, Clone)] @@ -44,7 +36,7 @@ pub struct Settings { pub icon: Option<Icon>, /// Platform specific settings. - pub platform_specific: platform::PlatformSpecific, + pub platform_specific: PlatformSpecific, } impl Default for Settings { @@ -78,9 +70,7 @@ impl From<Settings> for iced_winit::settings::Window { transparent: settings.transparent, always_on_top: settings.always_on_top, icon: settings.icon.map(Icon::into), - platform_specific: iced_winit::settings::PlatformSpecific::from( - settings.platform_specific, - ), + platform_specific: settings.platform_specific, } } } diff --git a/src/window/settings/macos.rs b/src/window/settings/macos.rs deleted file mode 100644 index c08020cf..00000000 --- a/src/window/settings/macos.rs +++ /dev/null @@ -1,20 +0,0 @@ -/// The platform specific window settings of an application. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] -pub struct PlatformSpecific { - /// Hides the window title. - pub title_hidden: bool, - /// Makes the titlebar transparent and allows the content to appear behind it. - pub titlebar_transparent: bool, - /// Makes the window content appear behind the titlebar. - pub fullsize_content_view: bool, -} - -impl From<PlatformSpecific> for iced_winit::settings::PlatformSpecific { - fn from(platform_specific: PlatformSpecific) -> Self { - Self { - title_hidden: platform_specific.title_hidden, - titlebar_transparent: platform_specific.titlebar_transparent, - fullsize_content_view: platform_specific.fullsize_content_view, - } - } -} diff --git a/src/window/settings/other.rs b/src/window/settings/other.rs deleted file mode 100644 index 943d9f0d..00000000 --- a/src/window/settings/other.rs +++ /dev/null @@ -1,9 +0,0 @@ -/// The platform specific window settings of an application. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] -pub struct PlatformSpecific; - -impl From<PlatformSpecific> for iced_winit::settings::PlatformSpecific { - fn from(_: PlatformSpecific) -> Self { - Default::default() - } -} |