forked from 1b-agent/opencadstudio-upstream
Dock: auto-hide per edge, hover only flies out when auto-hiding, menu per edge
- Auto-hide is a setting of the left / right edge rather than of each pallet: the pin on any docked pallet turns it on for its whole edge, which then shows only its icon strip until an icon is hovered. A floating pallet keeps its own auto-hide. - Hovering the strip icons only shows a group while the edge auto-hides; otherwise groups switch on click. - The + menu checks only the pallets open on that edge. Picking one that is open elsewhere (the other edge, floating) moves it to this edge; unchecking a checked one hides it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013RyGiMXcsf9HTKfqDxaQGt
This commit is contained in:
3 files changed
+115
-21
No files matched your search
+7
-3
@@ -1940,9 +1940,13 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
// catcher that closes it on any click elsewhere.
|
||||
if let Some(side) = self.dock_edge_menu {
|
||||
if !self.dock_visible_groups(side).is_empty() {
|
||||
// Checked = open and docked on this edge.
|
||||
let shown: Vec<_> = crate::ui::dock::PanelId::ALL
|
||||
.iter()
|
||||
.map(|p| (*p, self.dock_panel_visible(*p)))
|
||||
.map(|p| {
|
||||
let here = self.dock.location(*p).map(|(s, _)| s) == Some(side);
|
||||
(*p, here && self.dock_panel_visible(*p))
|
||||
})
|
||||
.collect();
|
||||
let (_, plus_top) = self.dock_strip_layout(side);
|
||||
let strip = crate::ui::dock::DOCK_STRIP_W;
|
||||
@@ -2927,7 +2931,7 @@ impl OpenCADStudio {
|
||||
tab: &'a DocumentTab,
|
||||
) -> Element<'a, Message> {
|
||||
let chrome = crate::ui::dock::Chrome {
|
||||
auto_collapse: self.dock.auto_collapse(id),
|
||||
auto_collapse: self.dock.auto_hides(id),
|
||||
floating,
|
||||
title_hovered: self.dock_title_hover == Some(id),
|
||||
};
|
||||
@@ -3635,7 +3639,7 @@ const DOCK_MENU_W: f32 = 230.0;
|
||||
|
||||
/// The pallet menu of an edge's + button, styled like the right-click menu:
|
||||
/// one row per pallet with its icon, its name and a check mark when it is
|
||||
/// shown. `shown` holds each pallet with that state.
|
||||
/// open on this edge. `shown` holds each pallet with that state.
|
||||
fn dock_edge_menu(
|
||||
side: crate::app::config::DockSide,
|
||||
shown: &[(crate::ui::dock::PanelId, bool)],
|
||||
|
||||
Reference in new issue
Block a user