diff --git a/crates/title_bar/src/platform_title_bar.rs b/crates/title_bar/src/platform_title_bar.rs index c40934c5ccfc41fecfdaa13131bd8c61b421f0dc..6ce7d089bb4641e2c1b7da710ebb0841fc51da4c 100644 --- a/crates/title_bar/src/platform_title_bar.rs +++ b/crates/title_bar/src/platform_title_bar.rs @@ -100,6 +100,24 @@ impl Render for PlatformTitleBar { } })) }) + .map(|this| { + // Note: On Windows the title bar behavior is handled by the platform implementation. + this.id(self.id.clone()) + .when(self.platform_style == PlatformStyle::Mac, |this| { + this.on_click(|event, window, _| { + if event.click_count() == 2 { + window.titlebar_double_click(); + } + }) + }) + .when(self.platform_style == PlatformStyle::Linux, |this| { + this.on_click(|event, window, _| { + if event.click_count() == 2 { + window.zoom_window(); + } + }) + }) + }) .map(|this| { if window.is_fullscreen() { this.pl_2() @@ -135,14 +153,6 @@ impl Render for PlatformTitleBar { .justify_between() .overflow_x_hidden() .w_full() - // Note: On Windows the title bar behavior is handled by the platform implementation. - .when(self.platform_style == PlatformStyle::Linux, |this| { - this.on_click(|event, window, _| { - if event.click_count() == 2 { - window.zoom_window(); - } - }) - }) .children(children), ) .when(!window.is_fullscreen(), |title_bar| {