Merge pull request #1730 from casperstorm/feat/platform-specific-window-options
Platform specific `window` options.
This commit is contained in:
commit
d7fffaa801
2 changed files with 8 additions and 2 deletions
|
|
@ -6,6 +6,6 @@ pub mod icon;
|
||||||
|
|
||||||
pub use icon::Icon;
|
pub use icon::Icon;
|
||||||
pub use position::Position;
|
pub use position::Position;
|
||||||
pub use settings::Settings;
|
pub use settings::{PlatformSpecific, Settings};
|
||||||
|
|
||||||
pub use crate::runtime::window::*;
|
pub use crate::runtime::window::*;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
use crate::window::{Icon, Position};
|
use crate::window::{Icon, Position};
|
||||||
|
|
||||||
|
pub use iced_winit::settings::PlatformSpecific;
|
||||||
|
|
||||||
/// The window settings of an application.
|
/// The window settings of an application.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Settings {
|
pub struct Settings {
|
||||||
|
|
@ -32,6 +34,9 @@ pub struct Settings {
|
||||||
|
|
||||||
/// The icon of the window.
|
/// The icon of the window.
|
||||||
pub icon: Option<Icon>,
|
pub icon: Option<Icon>,
|
||||||
|
|
||||||
|
/// Platform specific settings.
|
||||||
|
pub platform_specific: PlatformSpecific,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Settings {
|
impl Default for Settings {
|
||||||
|
|
@ -47,6 +52,7 @@ impl Default for Settings {
|
||||||
transparent: false,
|
transparent: false,
|
||||||
always_on_top: false,
|
always_on_top: false,
|
||||||
icon: None,
|
icon: None,
|
||||||
|
platform_specific: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -64,7 +70,7 @@ impl From<Settings> for iced_winit::settings::Window {
|
||||||
transparent: settings.transparent,
|
transparent: settings.transparent,
|
||||||
always_on_top: settings.always_on_top,
|
always_on_top: settings.always_on_top,
|
||||||
icon: settings.icon.map(Icon::into),
|
icon: settings.icon.map(Icon::into),
|
||||||
platform_specific: Default::default(),
|
platform_specific: settings.platform_specific,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue