File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,9 +16,29 @@ import QtQuick.Controls
1616ScrollView {
1717 id: root
1818
19- contentWidth: availableWidth // to only scroll vertically
19+ readonly property bool isMobile: (Qt .platform .os === " android" || Qt .platform .os === " ios" )
20+ property int scrollSpace: ! isMobile ? 10 : 0
2021
21- ScrollBar .vertical .policy : ScrollBar .AlwaysOff
22- ScrollBar .horizontal .policy : ScrollBar .AlwaysOff
22+ contentWidth: availableWidth - scrollSpace // to only scroll vertically
23+
24+ ScrollBar .horizontal : null
25+
26+ ScrollBar .vertical : ScrollBar {
27+ id: verticalScrollBar
28+
29+ policy: ScrollBar .AsNeeded
30+ visible: ! isMobile && (root .contentHeight > root .height )
31+ opacity: (pressed || root .moving ) ? 0.7 : 0.4
32+
33+ anchors .right : root .right
34+
35+ implicitHeight: root .height
36+
37+ contentItem: Rectangle {
38+ implicitWidth: 5
39+ radius: width / 2
40+ color: __style .darkGreenColor
41+ }
42+ }
2343
2444}
You can’t perform that action at this time.
0 commit comments