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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GMeyMxW5iedqAKWfY7MeJB
This commit is contained in:
Claude committed 2026-10-16 08:44:44 +00:00
1 parent 3c9404510f
commit 0acf039161
2 files changed
+14 -8

No files matched your search

+8 -7
View File
@@ -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 /// [`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 /// and close, shown like them only while the bar is hovered. A floating
/// alone at the top right. /// pallet has no title bar, so the control then sits alone at the top right.
pub fn title_bar_with<'a>( pub fn title_bar_with<'a>(
id: PanelId, id: PanelId,
title: String, title: String,
@@ -1104,16 +1104,17 @@ pub fn title_bar_with<'a>(
None => Space::new().width(0).height(0).into(), None => Space::new().width(0).height(0).into(),
}; };
} }
// The pin and close only show while the pointer is over the bar; the // The pallet's control, pin and close only show while the pointer is
// fixed height keeps the bar from jumping when they appear. // 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)] let mut bar = row![text(title).size(12), Space::new().width(Length::Fill)]
.spacing(3) .spacing(3)
.height(Length::Fixed(TITLE_BUTTON_H)) .height(Length::Fixed(TITLE_BUTTON_H))
.align_y(iced::Center); .align_y(iced::Center);
if let Some(extra) = extra {
bar = bar.push(extra);
}
if chrome.title_hovered { if chrome.title_hovered {
if let Some(extra) = extra {
bar = bar.push(extra);
}
bar = bar bar = bar
.push(pin_button( .push(pin_button(
id, id,
+6 -1
View File
@@ -1429,7 +1429,12 @@ pub fn view<'a>(
crate::ui::dock::title_bar_with( crate::ui::dock::title_bar_with(
PanelId::GraphicAttributes, PanelId::GraphicAttributes,
crate::t!("Graphic Attributes").into_owned(), 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( Some(header_menu(
side, side,
open_menu == Some(Menu::Header), open_menu == Some(Menu::Header),