nova-shell/PLAN-traymenu-fix.md
2026-04-12 12:29:28 +02:00

60 lines
1.8 KiB
Markdown

# Plan: fix tray menu grey bar
## Root cause
`Column` (a QML positioner) lays out children using their `height` property.
`implicitHeight` is advisory — layouts like `ColumnLayout` use it, but plain
`Column` does not. The delegate `Item`s in `TrayMenu.qml` set `implicitHeight`
but leave `height` at its default of 0, so every row collapses. The only
visible pixels are the Column's `topPadding + bottomPadding = 8 px` — the grey
bar.
The same mistake applies to `implicitWidth` on the delegate items and the back
button; the width happens to work because the children use `anchors` relative to
`parent` which already has `width: 220` from the Column, but it is still wrong
and should be fixed for clarity.
## Fix — TrayMenu.qml only, two places
### 1. Back button Item (line ~108)
```qml
// before
implicitWidth: page.implicitWidth
implicitHeight: 28
// after
width: page.width
height: 28
```
### 2. Repeater delegate Item (line ~142)
```qml
// before
implicitWidth: page.implicitWidth
implicitHeight: modelData.isSeparator ? 9 : 28
// after
width: page.width
height: modelData.isSeparator ? 9 : 28
```
## Also check: StackView height binding
The StackView currently binds:
```qml
height: currentItem ? currentItem.implicitHeight : 0
```
`Column.implicitHeight` is computed from children's `implicitHeight` (not
`height`), so it should be correct in principle — but once the delegate items
have a real `height`, `Column.implicitHeight` will equal `Column.height`
anyway. Worth verifying that `currentItem.implicitHeight` and
`currentItem.height` agree after the fix; if not, switch to `currentItem.height`.
## Expected result
Each menu row is 28 px tall (9 px for separators). The panel Rectangle sizes
correctly. The dismiss MouseArea still works. No other files need changing.