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 {
|
property ListView listView: ListView {
|
||||||
|
id: listView
|
||||||
x: 0
|
x: 0
|
||||||
y: control.style.borderWidth
|
y: control.style.borderWidth
|
||||||
width: control.width
|
width: control.width
|
||||||
height: control.listView.contentHeight
|
height: Math.min(control.style.maxComboBoxPopupHeight, control.listView.contentHeight)
|
||||||
interactive: false
|
|
||||||
model: control.model
|
model: control.model
|
||||||
Keys.onEscapePressed: comboBoxPopup.close()
|
Keys.onEscapePressed: comboBoxPopup.close()
|
||||||
currentIndex: control.highlightedIndex
|
currentIndex: control.highlightedIndex
|
||||||
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
|
|
||||||
|
ScrollBar.vertical: ScrollBar {
|
||||||
|
id: comboBoxPopupScrollBar
|
||||||
|
visible: listView.height < listView.contentHeight
|
||||||
|
}
|
||||||
|
|
||||||
delegate: ItemDelegate {
|
delegate: ItemDelegate {
|
||||||
id: itemDelegate
|
id: itemDelegate
|
||||||
|
@@ -71,6 +71,8 @@ QtObject {
|
|||||||
property real scrollBarActivePadding: Values.scrollBarActivePadding
|
property real scrollBarActivePadding: Values.scrollBarActivePadding
|
||||||
property real scrollBarInactivePadding: Values.scrollBarInactivePadding
|
property real scrollBarInactivePadding: Values.scrollBarInactivePadding
|
||||||
|
|
||||||
|
property real dialogScreenMargin: Values.dialogScreenMargin
|
||||||
|
|
||||||
// Special colors
|
// Special colors
|
||||||
property color interaction: Values.themeInteraction
|
property color interaction: Values.themeInteraction
|
||||||
property color interactionHover: Values.themeInteractionHover
|
property color interactionHover: Values.themeInteractionHover
|
||||||
|
@@ -185,6 +185,8 @@ QtObject {
|
|||||||
property real columnFactor: values.propertyLabelWidthMin
|
property real columnFactor: values.propertyLabelWidthMin
|
||||||
/ (values.propertyLabelWidthMin + values.controlColumnWidthMin)
|
/ (values.propertyLabelWidthMin + values.controlColumnWidthMin)
|
||||||
|
|
||||||
|
property real dialogScreenMargin: Math.round(160 * values.scaleFactor)
|
||||||
|
|
||||||
function responsiveResize(width) {
|
function responsiveResize(width) {
|
||||||
var tmpWidth = width - values.sectionColumnSpacing
|
var tmpWidth = width - values.sectionColumnSpacing
|
||||||
- values.sectionLeftPadding - values.sectionLayoutRightPadding
|
- values.sectionLeftPadding - values.sectionLayoutRightPadding
|
||||||
|
Reference in New Issue
Block a user