QmlDesigner: Add maximum height and scrollbar to TopLevelComboBox

Change-Id: I9af9b8df6ef9f307b0bb0fd6f0a673a09b1c9943
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
Thomas Hartmann
2023-08-31 16:24:50 +02:00
parent e348115237
commit 83fac0a5ee
3 changed files with 12 additions and 2 deletions

View File

@@ -128,14 +128,20 @@ T.ComboBox {
}
property ListView listView: ListView {
id: listView
x: 0
y: control.style.borderWidth
width: control.width
height: control.listView.contentHeight
interactive: false
height: Math.min(control.style.maxComboBoxPopupHeight, control.listView.contentHeight)
model: control.model
Keys.onEscapePressed: comboBoxPopup.close()
currentIndex: control.highlightedIndex
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar {
id: comboBoxPopupScrollBar
visible: listView.height < listView.contentHeight
}
delegate: ItemDelegate {
id: itemDelegate

View File

@@ -71,6 +71,8 @@ QtObject {
property real scrollBarActivePadding: Values.scrollBarActivePadding
property real scrollBarInactivePadding: Values.scrollBarInactivePadding
property real dialogScreenMargin: Values.dialogScreenMargin
// Special colors
property color interaction: Values.themeInteraction
property color interactionHover: Values.themeInteractionHover

View File

@@ -185,6 +185,8 @@ QtObject {
property real columnFactor: values.propertyLabelWidthMin
/ (values.propertyLabelWidthMin + values.controlColumnWidthMin)
property real dialogScreenMargin: Math.round(160 * values.scaleFactor)
function responsiveResize(width) {
var tmpWidth = width - values.sectionColumnSpacing
- values.sectionLeftPadding - values.sectionLayoutRightPadding