Support macOS Sequoia titlebar double-click action (#30468)
Closes #16527 Release Notes: - Added MacOS titlebar double-click action --- Unfortunately, Apple doesn't seem to make the "Fill" API public or documented anywhere. Co-authored-by: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
parent
f9f4be1fc4
commit
0ee900e8fb
4 changed files with 59 additions and 1 deletions
|
@ -179,7 +179,14 @@ impl Render for TitleBar {
|
|||
.justify_between()
|
||||
.w_full()
|
||||
// Note: On Windows the title bar behavior is handled by the platform implementation.
|
||||
.when(self.platform_style != PlatformStyle::Windows, |this| {
|
||||
.when(self.platform_style == PlatformStyle::Mac, |this| {
|
||||
this.on_click(|event, window, _| {
|
||||
if event.up.click_count == 2 {
|
||||
window.titlebar_double_click();
|
||||
}
|
||||
})
|
||||
})
|
||||
.when(self.platform_style == PlatformStyle::Linux, |this| {
|
||||
this.on_click(|event, window, _| {
|
||||
if event.up.click_count == 2 {
|
||||
window.zoom_window();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue