Add PlatformSpecific winit settings for macOS

This commit is contained in:
Andrew Bentley 2020-12-06 11:13:53 +01:00 committed by Héctor Ramón Jiménez
parent a7c40665fe
commit bbe5fe9d71
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
3 changed files with 32 additions and 6 deletions

View file

@ -2,10 +2,12 @@
#[cfg(target_os = "windows")]
#[path = "settings/windows.rs"]
mod platform;
#[cfg(not(target_os = "windows"))]
#[path = "settings/not_windows.rs"]
#[cfg(target_os = "macos")]
#[path = "settings/macos.rs"]
mod platform;
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
#[path = "settings/other.rs"]
mod platform;
pub use platform::PlatformSpecific;
use crate::conversion;
@ -137,6 +139,20 @@ impl Window {
.with_drag_and_drop(self.platform_specific.drag_and_drop);
}
#[cfg(target_os = "macos")]
{
use winit::platform::macos::WindowBuilderExtMacOS;
window_builder = window_builder
.with_title_hidden(self.platform_specific.title_hidden)
.with_titlebar_transparent(
self.platform_specific.titlebar_transparent,
)
.with_fullsize_content_view(
self.platform_specific.fullsize_content_view,
);
}
window_builder = window_builder
.with_fullscreen(conversion::fullscreen(primary_monitor, mode));