1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

macOS ViewportBuilder tweaks (#3613)

This commit is contained in:
Emil Ernerfeldt
2023-11-23 10:43:30 +01:00
committed by GitHub
parent 85489dc1dd
commit a2b15b23ad
6 changed files with 151 additions and 94 deletions

View File

@@ -1292,13 +1292,18 @@ pub fn create_winit_window_builder<T>(
maximize_button,
window_level,
// only handled on some platforms:
title_hidden: _title_hidden,
titlebar_transparent: _titlebar_transparent,
// macOS:
fullsize_content_view: _fullsize_content_view,
app_id: _app_id,
title_shown: _title_shown,
titlebar_buttons_shown: _titlebar_buttons_shown,
titlebar_shown: _titlebar_shown,
// Windows:
drag_and_drop: _drag_and_drop,
// wayland:
app_id: _app_id,
mouse_passthrough: _, // handled in `apply_viewport_builder_to_new_window`
} = viewport_builder;
@@ -1309,7 +1314,7 @@ pub fn create_winit_window_builder<T>(
.with_resizable(resizable.unwrap_or(true))
.with_visible(visible.unwrap_or(true))
.with_maximized(maximized.unwrap_or(false))
.with_window_level(match window_level {
.with_window_level(match window_level.unwrap_or_default() {
egui::viewport::WindowLevel::AlwaysOnBottom => WindowLevel::AlwaysOnBottom,
egui::viewport::WindowLevel::AlwaysOnTop => WindowLevel::AlwaysOnTop,
egui::viewport::WindowLevel::Normal => WindowLevel::Normal,
@@ -1383,8 +1388,9 @@ pub fn create_winit_window_builder<T>(
{
use winit::platform::macos::WindowBuilderExtMacOS as _;
window_builder = window_builder
.with_title_hidden(_title_hidden.unwrap_or(false))
.with_titlebar_transparent(_titlebar_transparent.unwrap_or(false))
.with_title_hidden(!_title_shown.unwrap_or(true))
.with_titlebar_buttons_hidden(!_titlebar_buttons_shown.unwrap_or(true))
.with_titlebar_transparent(!_titlebar_shown.unwrap_or(true))
.with_fullsize_content_view(_fullsize_content_view.unwrap_or(false));
}