Skip to content

Commit

Permalink
add option for undecorated_shadow on windows (#2285)
Browse files Browse the repository at this point in the history
* add option for undecorated_shadow on windows

* formated
  • Loading branch information
n1ght-hunter authored Sep 5, 2024
1 parent 6009420 commit d1ceada
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/window/settings/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ pub struct PlatformSpecific {

/// Whether show or hide the window icon in the taskbar.
pub skip_taskbar: bool,

/// Shows or hides the background drop shadow for undecorated windows.
///
/// The shadow is hidden by default.
/// Enabling the shadow causes a thin 1px line to appear on the top of the window.
pub undecorated_shadow: bool,
}

impl Default for PlatformSpecific {
fn default() -> Self {
Self {
drag_and_drop: true,
skip_taskbar: false,
undecorated_shadow: false,
}
}
}
4 changes: 4 additions & 0 deletions winit/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ pub fn window_attributes(

attributes = attributes
.with_skip_taskbar(settings.platform_specific.skip_taskbar);

window_builder = window_builder.with_undecorated_shadow(

Check failure on line 83 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all (windows-latest, stable)

cannot find value `window_builder` in this scope

Check failure on line 83 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all (windows-latest, stable)

cannot find value `window_builder` in this scope

Check failure on line 83 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all (windows-latest, stable)

cannot find value `window_builder` in this scope

Check failure on line 83 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all (windows-latest, stable)

cannot find value `window_builder` in this scope

Check failure on line 83 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / todos_windows

cannot find value `window_builder` in this scope

Check failure on line 83 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / todos_windows

cannot find value `window_builder` in this scope

Check failure on line 83 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all (windows-latest, beta)

cannot find value `window_builder` in this scope

Check failure on line 83 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all (windows-latest, beta)

cannot find value `window_builder` in this scope

Check failure on line 83 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all (windows-latest, beta)

cannot find value `window_builder` in this scope

Check failure on line 83 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all (windows-latest, beta)

cannot find value `window_builder` in this scope
settings.platform_specific.undecorated_shadow,
);
}

#[cfg(target_os = "macos")]
Expand Down

0 comments on commit d1ceada

Please sign in to comment.