1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 22:00:03 -04:00

macOS: Add movable_by_window_background option to viewport (#5412)

Add an option called `movable_by_window_background` alongside a new
builder method. When set to true, the window is movable by dragging its
background ([Apple
Docs](https://developer.apple.com/documentation/appkit/nswindow/ismovablebywindowbackground))

This is exclusive to macOS systems, similar to `fullsize_content_view`.

* [x] I have followed the instructions in the PR template
This commit is contained in:
Jim
2025-03-20 11:05:22 +01:00
committed by GitHub
parent 52732b23a6
commit d54e29d375
2 changed files with 21 additions and 1 deletions

View File

@@ -1615,6 +1615,7 @@ pub fn create_winit_window_attributes(
// macOS:
fullsize_content_view: _fullsize_content_view,
movable_by_window_background: _movable_by_window_background,
title_shown: _title_shown,
titlebar_buttons_shown: _titlebar_buttons_shown,
titlebar_shown: _titlebar_shown,
@@ -1761,7 +1762,8 @@ pub fn create_winit_window_attributes(
.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));
.with_fullsize_content_view(_fullsize_content_view.unwrap_or(false))
.with_movable_by_window_background(_movable_by_window_background.unwrap_or(false));
}
window_attributes