summaryrefslogtreecommitdiffstats
path: root/src/window/settings.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/window/settings.rs')
-rw-r--r--src/window/settings.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/window/settings.rs b/src/window/settings.rs
index 7bc49ce1..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)>,
@@ -18,9 +21,12 @@ pub struct Settings {
/// Whether the window should have a border, a title bar, etc. or not.
pub decorations: bool,
- /// Whether the window should be transparent
+ /// Whether the window should be transparent.
pub transparent: bool,
+ /// Whether the window will always be on top of other windows.
+ pub always_on_top: bool,
+
/// The icon of the window.
pub icon: Option<Icon>,
}
@@ -29,11 +35,13 @@ impl Default for Settings {
fn default() -> Settings {
Settings {
size: (1024, 768),
+ position: Position::default(),
min_size: None,
max_size: None,
resizable: true,
decorations: true,
transparent: false,
+ always_on_top: false,
icon: None,
}
}
@@ -44,11 +52,13 @@ 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,
decorations: settings.decorations,
transparent: settings.transparent,
+ always_on_top: settings.always_on_top,
icon: settings.icon.map(Icon::into),
platform_specific: Default::default(),
}