From c976d9a19c3af9c51edec30cdb4b1466d39bb70a Mon Sep 17 00:00:00 2001
From: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Date: Wed, 24 Apr 2013 13:53:34 +0200
Subject: [PATCH] Move ScrollBarStyle inside ScrollViewStyle

Change-Id: I22403a7deac19b614f08475a2b29696a5698811f
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
---
 src/controls/ScrollView.qml            |  4 ++--
 src/controls/TextArea.qml              | 10 +++++-----
 src/styles/Desktop/ScrollViewStyle.qml |  2 ++
 src/styles/ScrollViewStyle.qml         |  4 ++--
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/controls/ScrollView.qml b/src/controls/ScrollView.qml
index 3ce2054ad..46692fc10 100644
--- a/src/controls/ScrollView.qml
+++ b/src/controls/ScrollView.qml
@@ -135,9 +135,9 @@ FocusScope {
     /*! \internal */
     property int __scrollBarTopMargin: 0
     /*! \internal */
-    property alias horizontalScrollBar: scroller.horizontalScrollBar
+    property alias __horizontalScrollBar: scroller.horizontalScrollBar
     /*! \internal */
-    property alias verticalScrollBar: scroller.verticalScrollBar
+    property alias __verticalScrollBar: scroller.verticalScrollBar
     /*! \internal */
     property Component style: Qt.createComponent(Settings.theme() + "/ScrollViewStyle.qml", root)
 
diff --git a/src/controls/TextArea.qml b/src/controls/TextArea.qml
index 0cae59c87..d28f65569 100644
--- a/src/controls/TextArea.qml
+++ b/src/controls/TextArea.qml
@@ -390,7 +390,7 @@ ScrollView {
         if (length)
             string = "\n" + string
         text += string
-        verticalScrollBar.value = verticalScrollBar.maximumValue
+        __verticalScrollBar.value = __verticalScrollBar.maximumValue
     }
 
     /*!
@@ -651,10 +651,10 @@ ScrollView {
             if (!recursionGuard) {
                 recursionGuard = true
                 if (wrapMode == TextEdit.NoWrap) {
-                    horizontalScrollBar.visible = edit.paintedWidth + (2 * documentMargins) > area.viewport.width
+                    __horizontalScrollBar.visible = edit.paintedWidth + (2 * documentMargins) > area.viewport.width
                     edit.width = edit.paintedWidth + (2 * documentMargins)
                 } else {
-                    horizontalScrollBar.visible = false
+                    __horizontalScrollBar.visible = false
                     edit.width = area.viewport.width - (2 * documentMargins)
                 }
                 edit.height = Math.max(area.viewport.height - (2 * documentMargins), paintedHeight + (2 * documentMargins))
@@ -711,9 +711,9 @@ ScrollView {
 
     Keys.onPressed: {
         if (event.key == Qt.Key_PageUp) {
-            verticalScrollBar.value -= area.height
+            __verticalScrollBar.value -= area.height
         } else if (event.key == Qt.Key_PageDown)
-            verticalScrollBar.value += area.height
+            __verticalScrollBar.value += area.height
     }
 
 }
diff --git a/src/styles/Desktop/ScrollViewStyle.qml b/src/styles/Desktop/ScrollViewStyle.qml
index a8c35c14e..5102f19f0 100644
--- a/src/styles/Desktop/ScrollViewStyle.qml
+++ b/src/styles/Desktop/ScrollViewStyle.qml
@@ -51,6 +51,8 @@ Style {
 
     property StyleItem __styleitem: StyleItem { elementType: "frame" }
 
+    property Component scrollBar: ScrollBar {}
+
     property Component frame: StyleItem {
         id: styleitem
         elementType: "frame"
diff --git a/src/styles/ScrollViewStyle.qml b/src/styles/ScrollViewStyle.qml
index c10e7a864..ec8c083f9 100644
--- a/src/styles/ScrollViewStyle.qml
+++ b/src/styles/ScrollViewStyle.qml
@@ -49,13 +49,13 @@ Style {
     property int scrollBarSpacing: 4
     property int defaultFrameWidth: 1
 
+    property Component scrollBar: ScrollBarStyle{}
     property Component corner: Rectangle { color: "#ccc" }
-
     property Component frame: Rectangle {
         color: "white"
         border.color: "#999"
         border.width: 1
         radius: 1
-        visible: frameVisible
+        visible: control.frameVisible
     }
 }
-- 
GitLab