From 3dbbfb47c501ef1ce8d902b963ae2b053d00c3b0 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Thu, 16 Jul 2026 12:38:34 +0800 Subject: [PATCH] feat(tabs): double-click on tab zooms window instead of renaming Double-clicking a tab label in the title-bar strip now forwards to window.titlebar_double_click(), matching the rest of the titlebar, instead of entering inline rename. The sidebar drops double-click rename too for consistency. Renaming remains available via the tab context menu's "Rename Tab" item, which is now its only entry point. --- src/ui/tab_sidebar.rs | 11 ++++------- src/ui/tab_strip.rs | 17 ++++++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/ui/tab_sidebar.rs b/src/ui/tab_sidebar.rs index 17938d3a..0dd833e7 100644 --- a/src/ui/tab_sidebar.rs +++ b/src/ui/tab_sidebar.rs @@ -209,16 +209,13 @@ impl Tty7App { ) // Branch + diff line, when the pane sits in a git repo. .children(git_line) - // Single click activates; double click starts a rename. + // Click activates. (Renaming lives in the context menu, + // matching the strip — no double-click rename.) .on_mouse_down( MouseButton::Left, - cx.listener(move |this, ev: &MouseDownEvent, window, cx| { + cx.listener(move |this, _: &MouseDownEvent, window, cx| { cx.stop_propagation(); - if ev.click_count >= 2 { - this.start_rename(i, window, cx); - } else { - this.activate(i, window, cx); - } + this.activate(i, window, cx); }), ) // Drag the row by its label to reorder it (shared `DragTab`). diff --git a/src/ui/tab_strip.rs b/src/ui/tab_strip.rs index bf8fa6fb..552d7955 100644 --- a/src/ui/tab_strip.rs +++ b/src/ui/tab_strip.rs @@ -393,8 +393,9 @@ impl Tty7App { let has_cwd = cwd.is_some(); let mut menu = menu.min_w(px(200.)); - // Rename — the same inline edit a label double-click starts, given a - // discoverable entry point. + // Rename — the inline label edit's only entry point (a label + // double-click zooms the window instead, like the rest of the + // titlebar). menu = menu.item(PopupMenuItem::new("Rename Tab").on_click({ let app = app.clone(); move |_, window, cx| { @@ -593,16 +594,18 @@ impl Tty7App { // from the type, not from colour alone. .when(is_active, |d| d.font_weight(FontWeight::MEDIUM)) .child(label) - // Single click activates; double click starts a rename. + // Single click activates; double click zooms the window, + // same as the rest of the titlebar. (Renaming lives in the + // context menu.) .on_mouse_down( MouseButton::Left, cx.listener(move |this, ev: &MouseDownEvent, window, cx| { - // Swallow the event so it never reaches the enclosing - // TitleBar, whose double-click handler would otherwise - // zoom/maximize the window on a rename double-click. + // Swallow the event — on Windows the chip's `occlude()` + // means it would never reach the TitleBar anyway, so we + // forward the double-click zoom explicitly instead. cx.stop_propagation(); if ev.click_count >= 2 { - this.start_rename(i, window, cx); + window.titlebar_double_click(); } else { this.activate(i, window, cx); }