summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-05-03 09:34:34 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-04 20:09:34 +0200
commit666762d63f6a5844066a4eb81a759e93479a1d1d (patch)
tree3975be64ff4c09d8c5201f57dc8d619f6f1fb3ef
parent2e3dc46f73ce9514dfea4266c155cb6ac770becd (diff)
Allow TableView to scroll to bottom
Change-Id: If09c39341833e6162921c280bcc7583cca2fb15f Reviewed-by: Caroline Chao <caroline.chao@digia.com>
-rw-r--r--src/controls/ScrollView.qml4
-rw-r--r--src/controls/TableView.qml1
-rw-r--r--src/private/ScrollViewHelper.qml2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/controls/ScrollView.qml b/src/controls/ScrollView.qml
index 8dc1bd1b8..79ceb5848 100644
--- a/src/controls/ScrollView.qml
+++ b/src/controls/ScrollView.qml
@@ -135,6 +135,8 @@ FocusScope {
/*! \internal */
property int __scrollBarTopMargin: 0
/*! \internal */
+ property int __viewTopMargin: 0
+ /*! \internal */
property alias __horizontalScrollBar: scroller.horizontalScrollBar
/*! \internal */
property alias __verticalScrollBar: scroller.verticalScrollBar
@@ -231,7 +233,7 @@ FocusScope {
property bool verticalRecursionGuard: false
horizontalMaximumValue: flickableItem ? flickableItem.contentWidth - viewport.width : 0
- verticalMaximumValue: flickableItem ? flickableItem.contentHeight - viewport.height : 0
+ verticalMaximumValue: flickableItem ? flickableItem.contentHeight - viewport.height + __viewTopMargin : 0
Connections {
target: flickableItem
diff --git a/src/controls/TableView.qml b/src/controls/TableView.qml
index 305690c02..0917158f8 100644
--- a/src/controls/TableView.qml
+++ b/src/controls/TableView.qml
@@ -240,6 +240,7 @@ ScrollView {
frameVisible: true
__scrollBarTopMargin: Qt.platform.os === "mac" ? headerrow.height : 0
+ __viewTopMargin: headerrow.height
/*! \internal */
function __decrementCurrentIndex() {
diff --git a/src/private/ScrollViewHelper.qml b/src/private/ScrollViewHelper.qml
index 9c39e2b97..c8e1c8360 100644
--- a/src/private/ScrollViewHelper.qml
+++ b/src/private/ScrollViewHelper.qml
@@ -157,7 +157,7 @@ Item {
z: 1
anchors.bottom: cornerFill.top
anchors.bottomMargin: hscrollbar.visible ? 0 : frameMargin
- maximumValue: contentHeight > availableHeight ? contentHeight - availableHeight : 0
+ maximumValue: contentHeight > availableHeight ? contentHeight - availableHeight + __viewTopMargin : 0
minimumValue: 0
anchors.right: parent.right
anchors.top: parent.top