diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2014-06-25 10:27:39 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@digia.com> | 2014-06-25 10:27:39 +0200 |
commit | 91caf7531476d16c1c7a6d22705cb36ac93c5ab7 (patch) | |
tree | e4f67bcd61c55ba2b8cb4a4d01b10f69837c74e8 /src/controls/ComboBox.qml | |
parent | 1f0def9e8feca180680c1344cef6cf250b7630ba (diff) | |
parent | 6b876b21cd23f2af879543edf773dac41b4d0e97 (diff) | |
download | qtquickcontrols-91caf7531476d16c1c7a6d22705cb36ac93c5ab7.tar.gz |
Merge remote-tracking branch 'origin/5.3' into dev
Conflicts:
.qmake.conf
src/controls/Styles/Desktop/SpinBoxStyle.qml
Change-Id: Ia501c1388a2af9f273ec2742abbfc766717ad9e6
Diffstat (limited to 'src/controls/ComboBox.qml')
-rw-r--r-- | src/controls/ComboBox.qml | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml index 7a101969..995cdcde 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) { @@ -361,9 +372,9 @@ Control { font: __style && __style.editorFont !== undefined ? __style.editorFont : TextSingleton.font renderType: __style ? __style.renderType : Text.NativeRendering selectByMouse: true - color: __style.__syspal.text - selectionColor: __style.__syspal.highlight - selectedTextColor: __style.__syspal.highlightedText + color: SystemPaletteSingleton.text(enabled) + selectionColor: SystemPaletteSingleton.highlight(enabled) + selectedTextColor: SystemPaletteSingleton.highlightedText(enabled) onAccepted: { var idx = input.find(editText, Qt.MatchFixedString) if (idx > -1) { |