From 95c81fa6de8d511924d7b9d83990767bbad5bd69 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 20 Oct 2026 01:00:30 +0000 Subject: [PATCH] docking: say that the drag bar's menu opens on a right click A left click on the drag bar focuses it and opens nothing, as designed; the Hit::DragBar docs said otherwise. --- crates/ui/src/docking/hits.rs | 3 ++- crates/ui/src/docking/render/group.rs | 5 +++-- docs/ui-docking.md | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/ui/src/docking/hits.rs b/crates/ui/src/docking/hits.rs index e7728967..baff6508 100644 --- a/crates/ui/src/docking/hits.rs +++ b/crates/ui/src/docking/hits.rs @@ -14,7 +14,8 @@ use super::{DockArea, Floating, Layout, Node, render::RESIZE_HANDLES}; pub enum Hit

{ /// A tab: click activates, drag moves the panel (S1). Tab(P), - /// A group's drag bar: click opens the group menu, drag moves the group (S2). + /// A group's drag bar: drag moves the group; a right click, Enter or Space opens the group + /// menu (S2). DragBar(P), /// The top border of a group's strip: drag moves the group (S3). Border(P), diff --git a/crates/ui/src/docking/render/group.rs b/crates/ui/src/docking/render/group.rs index e38208a1..0c01112e 100644 --- a/crates/ui/src/docking/render/group.rs +++ b/crates/ui/src/docking/render/group.rs @@ -152,8 +152,9 @@ impl Renderer<'_, P> { ui.painter().rect_stroke(rect, 0.0, self.style.border, StrokeKind::Inside); } - /// The drag bar (`drag-bar`: click, double-click, menu and drag) or the top border band - /// (`drag-border`: drag only). Both move the whole group. + /// The drag bar (`drag-bar`: drag, double-click, and the group menu on a right click, Enter + /// or Space) or the top border band (`drag-border`: drag only). Both move the whole group; + /// a left click on the bar only focuses it. fn group_handle(&mut self, ui: &mut Ui, name: &'static str, hit: Rect, owner: &TabGroup<'_, P>, movable: bool) { if !crate::docking::targets::usable(hit) { return; diff --git a/docs/ui-docking.md b/docs/ui-docking.md index 9a0e924e..c971e847 100644 --- a/docs/ui-docking.md +++ b/docs/ui-docking.md @@ -180,6 +180,8 @@ A flyout fits its content the same way, without the title bar. - Drop previews show the destination: an outline for tabs, a line for a new group, column or dock, a filled half for a split. Escape or losing window focus cancels a drag. - Double-click a tab or drag bar to minimize a group to its strip. +- Right-click a tab for its menu, or a drag bar for the group menu; Enter or Space on a focused + drag bar opens it too. A left click on the drag bar only focuses it. - In the Frame profile, the mouse wheel over a tab strip selects the next or previous tab, and a middle click on a closable panel's tab closes it. `DockStyle::wheel_selects_tabs` and `middle_click_closes_tabs` turn either on or off in any profile.