summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar hatoo <hato2000@gmail.com>2019-12-01 14:55:05 +0900
committerLibravatar hatoo <hato2000@gmail.com>2019-12-01 14:55:05 +0900
commita33f49ff4b1c11e467ec492a96e1e05e4d32d6aa (patch)
tree74b63593e76ebf2171365b7cdc39cd6c00921c45 /src
parent5077f1dc6a6aca5ab84dd89296fb70489393cf57 (diff)
downloadiced-a33f49ff4b1c11e467ec492a96e1e05e4d32d6aa.tar.gz
iced-a33f49ff4b1c11e467ec492a96e1e05e4d32d6aa.tar.bz2
iced-a33f49ff4b1c11e467ec492a96e1e05e4d32d6aa.zip
Remove platform-specific logic from iced
Make Window.platform_specific use iced_winit::settings::PlatformSpecific
Diffstat (limited to 'src')
-rw-r--r--src/settings.rs (renamed from src/settings/mod.rs)14
-rw-r--r--src/settings/not_windows.rs14
-rw-r--r--src/settings/windows.rs21
3 files changed, 2 insertions, 47 deletions
diff --git a/src/settings/mod.rs b/src/settings.rs
index d64cfa13..a5820d87 100644
--- a/src/settings/mod.rs
+++ b/src/settings.rs
@@ -1,15 +1,5 @@
//! Configure your application.
-#[cfg(target_os = "windows")]
-#[path = "windows.rs"]
-pub mod platform;
-
-#[cfg(not(target_os = "windows"))]
-#[path = "not_windows.rs"]
-pub mod platform;
-
-pub use platform::PlatformSpecific;
-
/// The settings of an application.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct Settings {
@@ -34,7 +24,7 @@ pub struct Window {
pub decorations: bool,
/// Platform specific Setting.
- pub platform_specific: PlatformSpecific,
+ pub platform_specific: iced_winit::settings::PlatformSpecific,
}
impl Default for Window {
@@ -56,7 +46,7 @@ impl From<Settings> for iced_winit::Settings {
size: settings.window.size,
resizable: settings.window.resizable,
decorations: settings.window.decorations,
- platform_specific: settings.window.platform_specific.into(),
+ platform_specific: settings.window.platform_specific,
},
}
}
diff --git a/src/settings/not_windows.rs b/src/settings/not_windows.rs
deleted file mode 100644
index 1ae14c7f..00000000
--- a/src/settings/not_windows.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-#![cfg(not(target_os = "windows"))]
-//! Platform specific settings for not Windows.
-
-/// The platform specific window settings of an application.
-#[cfg(not(target_os = "windows"))]
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
-pub struct PlatformSpecific {}
-
-#[cfg(not(target_os = "windows"))]
-impl From<PlatformSpecific> for iced_winit::settings::PlatformSpecific {
- fn from(_: PlatformSpecific) -> iced_winit::settings::PlatformSpecific {
- iced_winit::settings::PlatformSpecific {}
- }
-}
diff --git a/src/settings/windows.rs b/src/settings/windows.rs
deleted file mode 100644
index 0372111f..00000000
--- a/src/settings/windows.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-#![cfg(target_os = "windows")]
-//! Platform specific settings for Windows.
-
-/// The platform specific window settings of an application.
-#[cfg(target_os = "windows")]
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
-pub struct PlatformSpecific {
- /// Parent Window
- pub parent: Option<winapi::shared::windef::HWND>,
-}
-
-#[cfg(target_os = "windows")]
-impl From<PlatformSpecific> for iced_winit::settings::PlatformSpecific {
- fn from(
- platform_specific: PlatformSpecific,
- ) -> iced_winit::settings::PlatformSpecific {
- iced_winit::settings::PlatformSpecific {
- parent: platform_specific.parent,
- }
- }
-}