Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions qt6/src/qml/ArrowListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ FocusScope {
const item = itemsView.itemAtIndex(0)
const measured = itemsView.contentHeight > 0 && item ? (item.height || item.implicitHeight) : 0
const showArrows = itemsView.count > maxVisibleItems
const arrowStrips = showArrows
? 2 * (DS.Style.arrowListView.stepButtonSize.height + contentLayout.spacing) + contentLayout.anchors.topMargin : 0
return Math.min(itemsView.count, maxVisibleItems) * (measured > 0 ? measured : itemHeight) + arrowStrips
const topMargin = contentLayout.anchors.topMargin
const extraHeight = topMargin + (showArrows
? 2 * (DS.Style.arrowListView.stepButtonSize.height + contentLayout.spacing) : 0)
return Math.min(itemsView.count, maxVisibleItems) * (measured > 0 ? measured : itemHeight) + extraHeight
}

implicitWidth: Math.max(DS.Style.arrowListView.width, contentLayout.implicitWidth)
Expand All @@ -33,7 +34,7 @@ FocusScope {
ColumnLayout {
id: contentLayout
anchors.fill: parent
anchors.topMargin: itemsView.interactive ? 6 : 0
anchors.topMargin: 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · ComboBox popups lose top spacing

When a ComboBox has more items than its maxVisibleItems limit, ArrowListView sets anchors.topMargin to 0, and ComboBox provides no replacement margin. Its sizedHeight omits the former 6px gap, leaving the popup 6px shorter and the up arrow flush with the popup edge.

Preserve the 6px top gap for ComboBox’s interactive list, either in ArrowListView or with an equivalent margin at the ComboBox call site.

Prompt for AI agents
In `qt6/src/qml/ArrowListView.qml` at line 37:

**ComboBox popups lose top spacing**

When a ComboBox has more items than its `maxVisibleItems` limit, `ArrowListView` sets `anchors.topMargin` to 0, and `ComboBox` provides no replacement margin. Its `sizedHeight` omits the former 6px gap, leaving the popup 6px shorter and the up arrow flush with the popup edge.

Preserve the 6px top gap for ComboBox’s interactive list, either in `ArrowListView` or with an equivalent margin at the ComboBox call site.

spacing: itemsView.interactive ? 6 : 0
P.ArrowListViewButton {
visible: itemsView.interactive
Expand Down
4 changes: 4 additions & 0 deletions qt6/src/qml/Menu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ T.Menu {
anchors.fill: parent

Loader {
id: headerLoader
Layout.fillWidth: true
Layout.preferredHeight: height
sourceComponent: control.header
Expand All @@ -61,6 +62,8 @@ T.Menu {
view.model: control.model
Layout.fillWidth: true
Layout.fillHeight: true
Layout.topMargin: headerLoader.item ? 6 : 0
Layout.bottomMargin: footerLoader.item ? 6 : 0
view.currentIndex: control.currentIndex
maxVisibleItems: control.maxVisibleItems
itemHeight: DS.Style.menu.item.height
Expand Down Expand Up @@ -89,6 +92,7 @@ T.Menu {
}
}
Loader {
id: footerLoader
Layout.fillWidth: true
Layout.preferredHeight: height
sourceComponent: control.footer
Expand Down
Loading