From 0acf039161a20240efb13795c25e6e0c7f045801 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 16 Oct 2026 08:44:44 +0000 Subject: [PATCH] Hide pallet title bar menu button until the bar is hovered The Graphic Attributes hamburger now shows and hides with the pin and close buttons, staying up while its menu is open. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GMeyMxW5iedqAKWfY7MeJB --- src/ui/dock.rs | 15 ++++++++------- src/ui/window/graphic_attributes.rs | 7 ++++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/ui/dock.rs b/src/ui/dock.rs index 87eb8016c..02b149158 100644 --- a/src/ui/dock.rs +++ b/src/ui/dock.rs @@ -1088,8 +1088,8 @@ pub fn title_bar<'a>(id: PanelId, title: String, chrome: Chrome) -> Element<'a, } /// [`title_bar`] with a pallet's own control (a menu button) before the pin -/// and close. A floating pallet has no title bar, so the control then sits -/// alone at the top right. +/// and close, shown like them only while the bar is hovered. A floating +/// pallet has no title bar, so the control then sits alone at the top right. pub fn title_bar_with<'a>( id: PanelId, title: String, @@ -1104,16 +1104,17 @@ pub fn title_bar_with<'a>( None => Space::new().width(0).height(0).into(), }; } - // The pin and close only show while the pointer is over the bar; the - // fixed height keeps the bar from jumping when they appear. + // The pallet's control, pin and close only show while the pointer is + // over the bar; the fixed height keeps the bar from jumping when they + // appear. let mut bar = row![text(title).size(12), Space::new().width(Length::Fill)] .spacing(3) .height(Length::Fixed(TITLE_BUTTON_H)) .align_y(iced::Center); - if let Some(extra) = extra { - bar = bar.push(extra); - } if chrome.title_hovered { + if let Some(extra) = extra { + bar = bar.push(extra); + } bar = bar .push(pin_button( id, diff --git a/src/ui/window/graphic_attributes.rs b/src/ui/window/graphic_attributes.rs index aabdd1a27..f8396457f 100644 --- a/src/ui/window/graphic_attributes.rs +++ b/src/ui/window/graphic_attributes.rs @@ -1429,7 +1429,12 @@ pub fn view<'a>( crate::ui::dock::title_bar_with( PanelId::GraphicAttributes, crate::t!("Graphic Attributes").into_owned(), - chrome, + // Keep the bar's controls up while the menu hangs off them, so + // moving into the menu does not hide its button and close it. + crate::ui::dock::Chrome { + title_hovered: chrome.title_hovered || open_menu == Some(Menu::Header), + ..chrome + }, Some(header_menu( side, open_menu == Some(Menu::Header),