From baa1153852c2935b565bb84199d98611840a2ccc Mon Sep 17 00:00:00 2001 From: Mentalflow <312902918@qq.com> Date: Mon, 21 Aug 2023 01:24:58 +0800 Subject: [PATCH] RibbonComboBox: Fix the popup menu's height while ListModel has single item. --- lib_source/qml/RibbonComboBox.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_source/qml/RibbonComboBox.qml b/lib_source/qml/RibbonComboBox.qml index b432586..526a1b3 100644 --- a/lib_source/qml/RibbonComboBox.qml +++ b/lib_source/qml/RibbonComboBox.qml @@ -147,10 +147,14 @@ ComboBox { y: control.height width: control.width 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 bottomMargin: 6 + padding:5 + topPadding: 7 + bottomPadding: 7 + contentItem: ListView { clip: true implicitHeight: contentHeight