summaryrefslogtreecommitdiff
path: root/src/controls/ComboBox.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/controls/ComboBox.qml')
-rw-r--r--src/controls/ComboBox.qml15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml
index 9cb2a9f4..cc949153 100644
--- a/src/controls/ComboBox.qml
+++ b/src/controls/ComboBox.qml
@@ -153,7 +153,7 @@ Control {
/*! \qmlproperty bool ComboBox::pressed
This property holds whether the button is being pressed. */
- readonly property bool pressed: mouseArea.pressed && mouseArea.containsMouse || popup.__popupVisible
+ readonly property bool pressed: mouseArea.effectivePressed || popup.__popupVisible
/*! \qmlproperty bool ComboBox::hovered
@@ -309,12 +309,23 @@ Control {
MouseArea {
id: mouseArea
+ property bool overridePressed: false
+ readonly property bool effectivePressed: (pressed || overridePressed) && containsMouse
anchors.fill: parent
hoverEnabled: true
onPressed: {
if (comboBox.activeFocusOnPress)
forceActiveFocus()
- popup.show()
+ if (!Settings.hasTouchScreen)
+ popup.show()
+ else
+ overridePressed = true
+ }
+ onCanceled: overridePressed = false
+ onClicked: {
+ if (Settings.hasTouchScreen)
+ popup.show()
+ overridePressed = false
}
onWheel: {
if (wheel.angleDelta.y > 0) {