feat(Windows): add skip taskbar methods (#2177)

This commit is contained in:
Amr Bashir 2022-04-01 20:21:09 +02:00 committed by GitHub
parent 52c4670237
commit ab1f636960
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 88 additions and 14 deletions

View file

@ -140,6 +140,9 @@ pub trait WindowExtWindows {
/// Returns the current window theme.
fn theme(&self) -> Theme;
/// Whether to show or hide the window icon in the taskbar.
fn set_skip_taskbar(&self, skip: bool);
}
impl WindowExtWindows for Window {
@ -167,6 +170,11 @@ impl WindowExtWindows for Window {
fn theme(&self) -> Theme {
self.window.theme()
}
#[inline]
fn set_skip_taskbar(&self, skip: bool) {
self.window.set_skip_taskbar(skip)
}
}
/// Additional methods on `WindowBuilder` that are specific to Windows.
@ -218,6 +226,9 @@ pub trait WindowBuilderExtWindows {
/// Forces a theme or uses the system settings if `None` was provided.
fn with_theme(self, theme: Option<Theme>) -> WindowBuilder;
/// Whether show or hide the window icon in the taskbar.
fn with_skip_taskbar(self, skip: bool) -> WindowBuilder;
}
impl WindowBuilderExtWindows for WindowBuilder {
@ -262,6 +273,12 @@ impl WindowBuilderExtWindows for WindowBuilder {
self.platform_specific.preferred_theme = theme;
self
}
#[inline]
fn with_skip_taskbar(mut self, skip: bool) -> WindowBuilder {
self.platform_specific.skip_taskbar = skip;
self
}
}
/// Additional methods on `MonitorHandle` that are specific to Windows.