forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user