summaryrefslogtreecommitdiff
path: root/src/controls/ScrollView.qml
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-05-02 18:18:08 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-08 21:42:37 +0200
commit2416927b67dcb4021edd38231295c13fe1b5a580 (patch)
treef7d31bc4c1640d867ef59c4109766c3cc0a336a6 /src/controls/ScrollView.qml
parent2ae89b14d8dcc7176af3d475b38d3c023a1897a2 (diff)
downloadqtquickcontrols-2416927b67dcb4021edd38231295c13fe1b5a580.tar.gz
Refactor and clean up public style API
Change-Id: I10271c860abd9b45a262e3548628e6a3026e1a4f Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/ScrollView.qml')
-rw-r--r--src/controls/ScrollView.qml16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/controls/ScrollView.qml b/src/controls/ScrollView.qml
index 62c0a8b2..a6d8a482 100644
--- a/src/controls/ScrollView.qml
+++ b/src/controls/ScrollView.qml
@@ -80,6 +80,8 @@ import QtQuick.Controls.Styles 1.0
In this case the content size of the ScrollView will simply mirror that of its contained
\l flickableItem.
+ You can create a custom appearance for a ScrollView by
+ assigning a ScrollViewStyle.
*/
FocusScope {
@@ -175,7 +177,7 @@ FocusScope {
if (status === Loader.Error)
console.error("Failed to load Style for", root)
}
- property alias control: root
+ property alias __control: root
}
Binding {
@@ -272,9 +274,8 @@ FocusScope {
ScrollViewHelper {
id: scroller
anchors.fill: parent
- property int frameWidth: frameVisible ? __style.frameWidth : 0
- property bool outerFrame: !frameVisible || !(__style ? __style.externalScrollBars : 0)
- property int scrollBarSpacing: outerFrame ? 0 : (__style ? __style.scrollBarSpacing : 0)
+ property bool outerFrame: !frameVisible || !(__style ? __style.__externalScrollBars : 0)
+ property int scrollBarSpacing: outerFrame ? 0 : (__style ? __style.__scrollBarSpacing : 0)
property int verticalScrollbarOffset: verticalScrollBar.visible && !verticalScrollBar.isTransient ?
verticalScrollBar.width + scrollBarSpacing : 0
property int horizontalScrollbarOffset: horizontalScrollBar.visible && !horizontalScrollBar.isTransient ?
@@ -291,9 +292,10 @@ FocusScope {
Item {
id: viewportItem
anchors.fill: frameLoader
- anchors.margins: scroller.frameWidth
- anchors.rightMargin: scroller.frameWidth + (scroller.outerFrame ? scroller.verticalScrollbarOffset : 0)
- anchors.bottomMargin: scroller.frameWidth + (scroller.outerFrame ? scroller.horizontalScrollbarOffset : 0)
+ anchors.topMargin: frameVisible ? __style.padding.top : 0
+ anchors.leftMargin: frameVisible ? __style.padding.left : 0
+ anchors.rightMargin: (frameVisible ? __style.padding.right : 0) + (scroller.outerFrame ? scroller.verticalScrollbarOffset : 0)
+ anchors.bottomMargin: (frameVisible ? __style.padding.bottom : 0) + (scroller.outerFrame ? scroller.horizontalScrollbarOffset : 0)
clip: true
}
}