Commit e019c44e authored by Jens Bache-Wiig's avatar Jens Bache-Wiig Committed by The Qt Project
Browse files

Allow mouse events when transient scroll bars are hidden


On mac, while transient scroll bars are not visible it was not
possible to interact with the viewport as the mouse events were
consumed by the scroll view.

This makes the ScrollBar mouse area disabled before a scroll is
triggered. Note that I also added a minor workaround to ensure
that we update the mouse cursor.

Task-number: QTBUG-32400
Change-Id: If091edf054fcab65feb9b8c8e5c45e25431f4be4
Reviewed-by: default avatarGabriel de Dietrich <gabriel.dedietrich@digia.com>
No related merge requests found
Showing with 9 additions and 6 deletions
......@@ -50,6 +50,8 @@ import QtQuick.Controls.Private 1.0
Item {
id: scrollbar
property bool isTransient: false
property bool active: false
property int orientation: Qt.Horizontal
property alias minimumValue: slider.minimumValue
property alias maximumValue: slider.maximumValue
......@@ -85,13 +87,12 @@ Item {
MouseArea {
id: internal
property bool horizontal: orientation === Qt.Horizontal
property int pageStep: internal.horizontal ? width : height
property int singleStep: 20
property bool scrollToClickposition: internal.scrollToClickPosition
anchors.fill: parent
cursorShape: __panel.visible ? Qt.ArrowCursor : Qt.IBeamCursor // forces a cursor change
property bool autoincrement: false
property bool scrollToClickPosition: __style ? __style.scrollToClickedPosition : 0
......
......@@ -121,8 +121,9 @@ Item {
ScrollBar {
id: hscrollbar
property bool isTransient: !!__panel && !!__panel.transient
property bool active: !!__panel && (__panel.sunken || __panel.activeControl != "none")
isTransient: !!__panel && !!__panel.transient
active: !!__panel && (__panel.sunken || __panel.activeControl !== "none")
enabled: !isTransient || __panel.visible
orientation: Qt.Horizontal
visible: contentWidth > availableWidth
height: visible ? implicitHeight : 0
......@@ -161,8 +162,9 @@ Item {
ScrollBar {
id: vscrollbar
property bool isTransient: !!__panel && !!__panel.transient
property bool active: !!__panel && (__panel.sunken || __panel.activeControl !== "none")
isTransient: !!__panel && !!__panel.transient
active: !!__panel && (__panel.sunken || __panel.activeControl !== "none")
enabled: !isTransient || __panel.visible
orientation: Qt.Vertical
visible: contentHeight > availableHeight
width: visible ? implicitWidth : 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment