mirror of
https://github.com/tauri-apps/tao.git
synced 2026-01-31 00:35:16 +01:00
feat: add WindowExtWindows::has_undecorated_shadow on Windows (#1074)
This commit is contained in:
5
.changes/has-undecorated-shadow.md
Normal file
5
.changes/has-undecorated-shadow.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tao": "patch"
|
||||
---
|
||||
|
||||
On Windows, add `WindowExtWindows::has_undecorated_shadow` to check if window has shadows for undecorated window or not.
|
||||
@@ -182,6 +182,9 @@ pub trait WindowExtWindows {
|
||||
/// Enabling the shadow causes a thin 1px line to appear on the top of the window.
|
||||
fn set_undecorated_shadow(&self, shadow: bool);
|
||||
|
||||
/// Returns whether this window has shadow for undecorated windows.
|
||||
fn has_undecorated_shadow(&self) -> bool;
|
||||
|
||||
/// Sets right-to-left layout.
|
||||
///
|
||||
/// Enabling this mainly flips the orientation of menus and title bar buttons
|
||||
@@ -236,6 +239,11 @@ impl WindowExtWindows for Window {
|
||||
self.window.set_undecorated_shadow(shadow)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn has_undecorated_shadow(&self) -> bool {
|
||||
self.window.has_undecorated_shadow()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn set_rtl(&self, rtl: bool) {
|
||||
self.window.set_rtl(rtl)
|
||||
|
||||
@@ -1116,6 +1116,15 @@ impl Window {
|
||||
});
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn has_undecorated_shadow(&self) -> bool {
|
||||
self
|
||||
.window_state
|
||||
.lock()
|
||||
.window_flags
|
||||
.contains(WindowFlags::MARKER_UNDECORATED_SHADOW)
|
||||
}
|
||||
|
||||
pub fn set_content_protection(&self, enabled: bool) {
|
||||
unsafe {
|
||||
let _ = SetWindowDisplayAffinity(
|
||||
|
||||
Reference in New Issue
Block a user