From 7a2c155ebfb54e83105a4e5df5601e3156c1732a Mon Sep 17 00:00:00 2001 From: ivanpasq Date: Mon, 3 Nov 2025 18:41:28 +0100 Subject: [PATCH] feat: added double tap to the whole title bar --- crates/title_bar/src/platform_title_bar.rs | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) 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| {