summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@gmail.com>2014-04-02 15:04:11 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-04 10:11:30 +0200
commit783da20117857dbc840b9863f2cb4227773b338c (patch)
treeda23bb178dbe480ce839a270daed8df6ca8e5ffe
parentcca3c68333431431aca9b904b6582de7220175b8 (diff)
downloadqtquickcontrols-783da20117857dbc840b9863f2cb4227773b338c.tar.gz
Improve scrollbars on touch
Hide the scrollbar background which makes it look like a desktop scrollbar. Scrollbars are now by default non-interactive on touch. [ChangeLog][QtQuickControls][ScrollView] Scrollbars are now non-interactive on mobile/touch devices. Task-number: QTBUG-37387 Change-Id: I63b6db9309a6e33140de0d26c8d4fd3e1bcfb832 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
-rw-r--r--src/controls/Private/ScrollBar.qml3
-rw-r--r--src/controls/Styles/Base/ScrollViewStyle.qml2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/controls/Private/ScrollBar.qml b/src/controls/Private/ScrollBar.qml
index 65ed51cf..1734e496 100644
--- a/src/controls/Private/ScrollBar.qml
+++ b/src/controls/Private/ScrollBar.qml
@@ -101,7 +101,8 @@ Item {
onEntered: if (!pressed) __panel.activeControl = __panel.hitTest(mouseX, mouseY)
onExited: if (!pressed) __panel.activeControl = "none"
onMouseXChanged: if (!pressed) __panel.activeControl = __panel.hitTest(mouseX, mouseY)
- hoverEnabled: true
+ hoverEnabled: !Settings.hasTouchScreen
+ enabled: !Settings.hasTouchScreen // TODO: touch on desktop?
property var pressedX
property var pressedY
diff --git a/src/controls/Styles/Base/ScrollViewStyle.qml b/src/controls/Styles/Base/ScrollViewStyle.qml
index a7dbcc52..1944ed43 100644
--- a/src/controls/Styles/Base/ScrollViewStyle.qml
+++ b/src/controls/Styles/Base/ScrollViewStyle.qml
@@ -117,7 +117,7 @@ Style {
implicitHeight: Math.round(TextSingleton.implicitHeight)
clip: true
opacity: transientScrollBars ? 0.5 : 1.0
- visible: !transientScrollBars || sticky
+ visible: !Settings.hasTouchScreen && (!transientScrollBars || sticky)
Rectangle {
anchors.fill: parent
color: "#ddd"