Add option to enable/disable WS_CLIPCHILDREN window style (#3212)

This commit is contained in:
Amr Bashir 2024-01-22 19:55:37 +02:00 committed by GitHub
parent 0cc19716f3
commit 10a785019c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 1 deletions

View file

@ -315,6 +315,9 @@ pub trait WindowBuilderExtWindows {
/// Enabling the shadow causes a thin 1px line to appear on the top of the window.
fn with_undecorated_shadow(self, shadow: bool) -> Self;
/// This sets or removes `WS_CLIPCHILDREN` style.
fn with_clip_children(self, flag: bool) -> Self;
/// Sets the color of the window border.
///
/// Supported starting with Windows 11 Build 22000.
@ -385,6 +388,12 @@ impl WindowBuilderExtWindows for WindowBuilder {
self
}
#[inline]
fn with_clip_children(mut self, flag: bool) -> Self {
self.window.platform_specific.clip_children = flag;
self
}
#[inline]
fn with_border_color(mut self, color: Option<Color>) -> Self {
self.window.platform_specific.border_color = Some(color.unwrap_or(Color::NONE));