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 GitHub
parent e33d2bee6c
commit 75173118b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;