fix(slint): unblock header menu hover-switch, tighten panel + tabs

The click-outside scrim was a full-window TouchArea — it covered the
tabs and intercepted their hover events, so hover-switching between
menus still did not work (same failure mode as the old PopupWindow
grab). The scrim now starts below the header, leaving the tabs
hoverable. The panel also dropped from header-height + 6px to 45px,
removing the unjustified gap between the tab and its dropdown. Header
tab labels lost another 2px of right padding.

cc
This commit is contained in:
vicrodh committed 2026-05-19 04:53:03 -06:00
1 parent 5972e8052b
commit 9a964477e5
2 files changed
+11 -5

No files matched your search

+1 -1
View File
@@ -59,7 +59,7 @@ component NavTab inherits Rectangle {
tab-row := HorizontalLayout {
padding-left: root.show-icon ? 11px : 13px;
padding-right: 13px;
padding-right: 11px;
spacing: 6px;
if root.show-icon: VerticalLayout {
alignment: center;
@@ -61,10 +61,14 @@ export component HeaderMenuOverlay inherits Rectangle {
}
}
// Full-window transparent scrim — a click anywhere outside the panel
// closes the menu. Declared before the panel so the panel sits on
// top and its own TouchArea wins over this one.
// Transparent scrim — a click outside the panel closes the menu.
// It starts BELOW the header so the tabs stay hoverable while a menu
// is open: a full-window scrim would intercept the tabs' hover
// events and block hover-switching, exactly like the old
// PopupWindow's pointer grab did.
if HeaderMenuState.open-index >= 0: TouchArea {
y: Layout.header-height;
height: parent.height - Layout.header-height;
clicked => {
root.close-menu();
}
@@ -74,7 +78,9 @@ export component HeaderMenuOverlay inherits Rectangle {
// surface-main background, 1px border-muted, Radius.sm, drop shadow.
if HeaderMenuState.open-index >= 0: panel := Rectangle {
x: HeaderMenuState.anchor-x;
y: Layout.header-height + 6px;
// Snug under the tabs — the 30px tab is centered in the 48px
// header, so its bottom edge sits at ~39px.
y: 45px;
width: 188px;
height: panel-box.preferred-height;