Merge pull request #543 from twitchyliquid64/master
Fixes #539: Allow windows to be set always_on_top
This commit is contained in:
commit
c393e450a1
@ -18,9 +18,12 @@ pub struct Settings {
|
|||||||
/// Whether the window should have a border, a title bar, etc. or not.
|
/// Whether the window should have a border, a title bar, etc. or not.
|
||||||
pub decorations: bool,
|
pub decorations: bool,
|
||||||
|
|
||||||
/// Whether the window should be transparent
|
/// Whether the window should be transparent.
|
||||||
pub transparent: bool,
|
pub transparent: bool,
|
||||||
|
|
||||||
|
/// Whether the window will always be on top of other windows.
|
||||||
|
pub always_on_top: bool,
|
||||||
|
|
||||||
/// The icon of the window.
|
/// The icon of the window.
|
||||||
pub icon: Option<Icon>,
|
pub icon: Option<Icon>,
|
||||||
}
|
}
|
||||||
@ -34,6 +37,7 @@ impl Default for Settings {
|
|||||||
resizable: true,
|
resizable: true,
|
||||||
decorations: true,
|
decorations: true,
|
||||||
transparent: false,
|
transparent: false,
|
||||||
|
always_on_top: false,
|
||||||
icon: None,
|
icon: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -49,6 +53,7 @@ impl From<Settings> for iced_winit::settings::Window {
|
|||||||
resizable: settings.resizable,
|
resizable: settings.resizable,
|
||||||
decorations: settings.decorations,
|
decorations: settings.decorations,
|
||||||
transparent: settings.transparent,
|
transparent: settings.transparent,
|
||||||
|
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: Default::default(),
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,12 @@ pub struct Window {
|
|||||||
/// Whether the window should have a border, a title bar, etc.
|
/// Whether the window should have a border, a title bar, etc.
|
||||||
pub decorations: bool,
|
pub decorations: bool,
|
||||||
|
|
||||||
/// Whether the window should be transparent
|
/// Whether the window should be transparent.
|
||||||
pub transparent: bool,
|
pub transparent: bool,
|
||||||
|
|
||||||
|
/// Whether the window will always be on top of other windows.
|
||||||
|
pub always_on_top: bool,
|
||||||
|
|
||||||
/// The window icon, which is also usually used in the taskbar
|
/// The window icon, which is also usually used in the taskbar
|
||||||
pub icon: Option<winit::window::Icon>,
|
pub icon: Option<winit::window::Icon>,
|
||||||
|
|
||||||
@ -74,6 +77,7 @@ impl Window {
|
|||||||
.with_decorations(self.decorations)
|
.with_decorations(self.decorations)
|
||||||
.with_transparent(self.transparent)
|
.with_transparent(self.transparent)
|
||||||
.with_window_icon(self.icon)
|
.with_window_icon(self.icon)
|
||||||
|
.with_always_on_top(self.always_on_top)
|
||||||
.with_fullscreen(conversion::fullscreen(primary_monitor, mode));
|
.with_fullscreen(conversion::fullscreen(primary_monitor, mode));
|
||||||
|
|
||||||
if let Some((width, height)) = self.min_size {
|
if let Some((width, height)) = self.min_size {
|
||||||
@ -108,6 +112,7 @@ impl Default for Window {
|
|||||||
resizable: true,
|
resizable: true,
|
||||||
decorations: true,
|
decorations: true,
|
||||||
transparent: false,
|
transparent: false,
|
||||||
|
always_on_top: false,
|
||||||
icon: None,
|
icon: None,
|
||||||
platform_specific: Default::default(),
|
platform_specific: Default::default(),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user