Merge pull request #1839 from MarcelP102/Graphic-Attributes-fix

FIX: Hide pallet title bar menu button until the bar is hovered
This commit is contained in:
Hakan Seven committed 2026-10-16 22:39:56 +03:00
commit 28f51ce270
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
/// 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,
+6 -1
View File
@@ -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),