RibbonComboBox: Fix the popup menu's height while ListModel has single item.

This commit is contained in:
Mentalflow 2023-08-21 01:24:58 +08:00
parent 1d3a2e6d71
commit baa1153852
Signed by: Mentalflow
GPG Key ID: 5AE68D4401A2EE71
1 changed files with 5 additions and 1 deletions

View File

@ -147,10 +147,14 @@ ComboBox {
y: control.height y: control.height
width: control.width width: control.width
height: origin_height height: origin_height
property int origin_height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) property int origin_height: Math.min(contentItem.implicitHeight + topInset + topPadding + bottomPadding + bottomInset, control.Window.height - topMargin - bottomMargin)
topMargin: 6 topMargin: 6
bottomMargin: 6 bottomMargin: 6
padding:5
topPadding: 7
bottomPadding: 7
contentItem: ListView { contentItem: ListView {
clip: true clip: true
implicitHeight: contentHeight implicitHeight: contentHeight