On Windows, add option to customize window class name (#2978)

This commit is contained in:
Géraud-Loup
2023-07-29 15:39:23 +02:00
committed by Kirill Chibisov
parent 645b1ff00f
commit f69616ac2c
5 changed files with 16 additions and 6 deletions

View File

@@ -223,6 +223,9 @@ pub trait WindowBuilderExtWindows {
/// Whether show or hide the window icon in the taskbar.
fn with_skip_taskbar(self, skip: bool) -> WindowBuilder;
/// Customize the window class name.
fn with_class_name<S: Into<String>>(self, class_name: S) -> WindowBuilder;
/// Shows or hides the background drop shadow for undecorated windows.
///
/// The shadow is hidden by default.
@@ -267,6 +270,12 @@ impl WindowBuilderExtWindows for WindowBuilder {
self
}
#[inline]
fn with_class_name<S: Into<String>>(mut self, class_name: S) -> WindowBuilder {
self.platform_specific.class_name = class_name.into();
self
}
#[inline]
fn with_undecorated_shadow(mut self, shadow: bool) -> WindowBuilder {
self.platform_specific.decoration_shadow = shadow;