diff options
author | 2021-07-22 17:49:18 +0700 | |
---|---|---|
committer | 2021-07-22 17:49:18 +0700 | |
commit | 9cf5f3e1ef19f67b7939b9a747c2f66ad6b5275c (patch) | |
tree | 4c9af75c3a0b7d0d7a5e664ec55fbdbc24cd9f88 /src/window/settings.rs | |
parent | 8fe8b6b168f193fadb495c78c076262d9114b14e (diff) | |
parent | 39b8f7de50ca53c67214c4ec2af2d3a0944f006a (diff) | |
download | iced-9cf5f3e1ef19f67b7939b9a747c2f66ad6b5275c.tar.gz iced-9cf5f3e1ef19f67b7939b9a747c2f66ad6b5275c.tar.bz2 iced-9cf5f3e1ef19f67b7939b9a747c2f66ad6b5275c.zip |
Merge pull request #929 from TimUntersberger/winit-improv
feat: add position to window settings
Diffstat (limited to 'src/window/settings.rs')
-rw-r--r-- | src/window/settings.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/window/settings.rs b/src/window/settings.rs index 6b5d2985..ec6c3071 100644 --- a/src/window/settings.rs +++ b/src/window/settings.rs @@ -1,4 +1,4 @@ -use crate::window::Icon; +use crate::window::{Icon, Position}; /// The window settings of an application. #[derive(Debug, Clone)] @@ -6,6 +6,9 @@ pub struct Settings { /// The initial size of the window. pub size: (u32, u32), + /// The initial position of the window. + pub position: Position, + /// The minimum size of the window. pub min_size: Option<(u32, u32)>, @@ -32,6 +35,7 @@ impl Default for Settings { fn default() -> Settings { Settings { size: (1024, 768), + position: Position::default(), min_size: None, max_size: None, resizable: true, @@ -48,6 +52,7 @@ impl From<Settings> for iced_winit::settings::Window { fn from(settings: Settings) -> Self { Self { size: settings.size, + position: iced_winit::Position::from(settings.position), min_size: settings.min_size, max_size: settings.max_size, resizable: settings.resizable, |