diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml index fadd2a16e32c562fe95685be8289cd0088e07846..5127954ebfb158b863e260c8276d84ef74481b3b 100644 --- a/src/controls/ComboBox.qml +++ b/src/controls/ComboBox.qml @@ -104,7 +104,11 @@ Control { onPressedChanged: if (pressed) popup.show() } - StyleItem { id: styleItem } + StyleItem { + id: styleItem + elementType: "comboboxitem" + visible: false + } Component.onCompleted: { if (currentIndex === -1) @@ -112,7 +116,6 @@ Control { if (styleItem.style == "mac") { popup.x -= 10 popup.y += 4 - popup.__font.pointSize = 13 } popup.ready = true @@ -136,6 +139,7 @@ Control { property int y: isPopup ? (comboBox.__panel.height - comboBox.__panel.implicitHeight) / 2.0 : comboBox.__panel.height __minimumWidth: comboBox.width __visualItem: comboBox + __font: styleItem.font property ExclusiveGroup eg: ExclusiveGroup { id: eg } diff --git a/src/styles/Desktop/ComboBoxStyle.qml b/src/styles/Desktop/ComboBoxStyle.qml index 252d5972359176a69264d664bade967a724ad1fb..36d00dc4d626982b8f16bd980db267dde6bedfdd 100644 --- a/src/styles/Desktop/ComboBoxStyle.qml +++ b/src/styles/Desktop/ComboBoxStyle.qml @@ -54,7 +54,8 @@ Style { enabled: control.enabled text: control.currentText hasFocus: control.activeFocus - contentHeight: 18 + // contentHeight as in QComboBox + contentHeight: Math.max(Math.ceil(textHeight("")), 14) + 2 contentWidth: textWidth(text) }