diff options
author | 2020-07-01 22:44:11 +0200 | |
---|---|---|
committer | 2020-07-01 22:44:11 +0200 | |
commit | 5190bcea804d74a3373dbb09477770ff4814e866 (patch) | |
tree | fe1db142ce6705e35d003ad5d975ec0c17313a8a /src/window/settings.rs | |
parent | 08e13e00f15fb54ced21c0375e7efba4bfbf89a0 (diff) | |
parent | a0cc7e4e43f16de4c19607f913b7f587c61aa5ef (diff) | |
download | iced-5190bcea804d74a3373dbb09477770ff4814e866.tar.gz iced-5190bcea804d74a3373dbb09477770ff4814e866.tar.bz2 iced-5190bcea804d74a3373dbb09477770ff4814e866.zip |
Merge pull request #285 from frapa/add_support_for_window_icons
Add support for setting window icon
Diffstat (limited to 'src/window/settings.rs')
-rw-r--r-- | src/window/settings.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/window/settings.rs b/src/window/settings.rs index eb997899..2046f2d9 100644 --- a/src/window/settings.rs +++ b/src/window/settings.rs @@ -1,5 +1,7 @@ +use crate::window::Icon; + /// The window settings of an application. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone)] pub struct Settings { /// The initial size of the window. pub size: (u32, u32), @@ -15,6 +17,9 @@ pub struct Settings { /// Whether the window should have a border, a title bar, etc. or not. pub decorations: bool, + + /// The icon of the window. + pub icon: Option<Icon>, } impl Default for Settings { @@ -25,6 +30,7 @@ impl Default for Settings { max_size: None, resizable: true, decorations: true, + icon: None, } } } @@ -38,6 +44,7 @@ impl From<Settings> for iced_winit::settings::Window { max_size: settings.max_size, resizable: settings.resizable, decorations: settings.decorations, + icon: settings.icon.map(Icon::into), platform_specific: Default::default(), } } |