From 70ce1b2bf7e5b310fe2875f5bc965116ee69dd46 Mon Sep 17 00:00:00 2001 From: vladest Date: Wed, 28 Mar 2018 21:48:44 +0200 Subject: [PATCH] Fix invalid scrolling detection --- interface/resources/qml/hifi/tablet/Edit.qml | 6 +++++- interface/resources/qml/windows/ScrollingWindow.qml | 7 +++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/Edit.qml b/interface/resources/qml/hifi/tablet/Edit.qml index ef38cdeb51..4acced86ce 100644 --- a/interface/resources/qml/hifi/tablet/Edit.qml +++ b/interface/resources/qml/hifi/tablet/Edit.qml @@ -1,5 +1,5 @@ import QtQuick 2.7 -import QtQuick.Controls 2.2 +import QtQuick.Controls 2.3 StackView { id: editRoot @@ -8,6 +8,9 @@ StackView { signal sendToScript(var message); topPadding: 40 + leftPadding: 0 + rightPadding: 0 + bottomPadding: 0 property var itemProperties: {"y": editRoot.topPadding, "width": editRoot.availableWidth, @@ -20,6 +23,7 @@ StackView { color: "#404040" //default background color EditTabView { id: tab + anchors.fill: parent currentIndex: -1 onCurrentIndexChanged: { editRoot.replace(null, tab.itemAt(currentIndex).visualItem, diff --git a/interface/resources/qml/windows/ScrollingWindow.qml b/interface/resources/qml/windows/ScrollingWindow.qml index 61e22c0400..c156b80388 100644 --- a/interface/resources/qml/windows/ScrollingWindow.qml +++ b/interface/resources/qml/windows/ScrollingWindow.qml @@ -46,8 +46,6 @@ Window { // type should only consist of logic sized areas, with nothing drawn (although the // default value for the frame property does include visual decorations) property var pane: Item { - property bool isScrolling: Qt.binding(function() { return scrollView.contentHeight > scrollView.height; }); - property int contentWidth: scrollView.width property int scrollHeight: scrollView.height @@ -81,15 +79,16 @@ Window { contentItem.children: [ content ] contentHeight: content.height boundsBehavior: Flickable.StopAtBounds + property bool isScrolling: (contentHeight - height) > 10 ? true : false clip: true - anchors.rightMargin: parent.isScrolling ? verticalScrollWidth : 0 + anchors.rightMargin: isScrolling ? verticalScrollWidth : 0 anchors.fill: parent anchors.bottomMargin: footerPane.height ScrollBar.vertical: ScrollBar { - policy: scrollView.contentHeight > scrollView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff + policy: scrollView.isScrolling ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff parent: scrollView.parent anchors.top: scrollView.top anchors.right: scrollView.right