diff options
author | 2022-10-19 22:56:00 -0300 | |
---|---|---|
committer | 2023-01-09 11:27:04 -0800 | |
commit | 1bc0c480f9747826b244c30e92d8c4a29b576e4a (patch) | |
tree | cfe793f0ad7977c334fb729bdb989dc6a88b4496 /winit/src/settings.rs | |
parent | a386788b67bf4e008916e79a8c7dd7289a3ab3cd (diff) | |
download | iced-1bc0c480f9747826b244c30e92d8c4a29b576e4a.tar.gz iced-1bc0c480f9747826b244c30e92d8c4a29b576e4a.tar.bz2 iced-1bc0c480f9747826b244c30e92d8c4a29b576e4a.zip |
move window settings to `iced_native`
Diffstat (limited to '')
-rw-r--r-- | winit/src/settings.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/winit/src/settings.rs b/winit/src/settings.rs index ea0ba361..78c8c156 100644 --- a/winit/src/settings.rs +++ b/winit/src/settings.rs @@ -22,6 +22,7 @@ mod platform; pub use platform::PlatformSpecific; use crate::conversion; +use crate::Icon; use crate::Position; use winit::monitor::MonitorHandle; use winit::window::WindowBuilder; @@ -201,3 +202,23 @@ impl Default for Window { } } } + +impl From<iced_native::window::Settings> for Window { + fn from(settings: iced_native::window::Settings) -> Self { + Self { + size: settings.size, + position: Position::from(settings.position), + min_size: settings.min_size, + max_size: settings.max_size, + visible: settings.visible, + resizable: settings.resizable, + decorations: settings.decorations, + transparent: settings.transparent, + always_on_top: settings.always_on_top, + icon: settings.icon.and_then(|icon| { + Icon::try_from(icon).map(winit::window::Icon::from).ok() + }), + platform_specific: Default::default(), + } + } +} |