forked from 1b-agent/opencadstudio-upstream
fix(statusbar): open the layout context menu at the clicked tab
The right-click menu was pinned to the screen's bottom-left corner. Each layout tab now records its screen bounds through a PosReport wrapper (which learned runtime-built ids for the dynamic tab names), and the menu anchors next to the clicked tab via the shared status-bar popup positioning, falling back to the left edge only when no bounds were recorded (#428). Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
8821bb7131
commit
d6b1307a0e
4 files changed
+30
-20
No files matched your search
+10
-4
@@ -742,10 +742,16 @@ fn space_tab<'a>(
|
||||
let ctx_msg = Message::LayoutContextMenu(label.clone());
|
||||
|
||||
// Use mouse_area so we can capture right-click for the context menu.
|
||||
mouse_area(display)
|
||||
.on_press(switch_msg)
|
||||
.on_right_press(ctx_msg)
|
||||
.into()
|
||||
// PosReport records the tab's screen bounds so the context menu can
|
||||
// anchor next to the clicked tab instead of the screen's left edge
|
||||
// (#428).
|
||||
crate::ui::wrap_bar::PosReport::owned(
|
||||
format!("SB_LAYOUT_TAB:{label}"),
|
||||
mouse_area(display)
|
||||
.on_press(switch_msg)
|
||||
.on_right_press(ctx_msg),
|
||||
)
|
||||
.into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user