mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 17:41:12 +02:00
Fix invalid scrolling detection
This commit is contained in:
parent
001b6d23ff
commit
70ce1b2bf7
2 changed files with 8 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
import QtQuick 2.7
|
import QtQuick 2.7
|
||||||
import QtQuick.Controls 2.2
|
import QtQuick.Controls 2.3
|
||||||
|
|
||||||
StackView {
|
StackView {
|
||||||
id: editRoot
|
id: editRoot
|
||||||
|
@ -8,6 +8,9 @@ StackView {
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
|
|
||||||
topPadding: 40
|
topPadding: 40
|
||||||
|
leftPadding: 0
|
||||||
|
rightPadding: 0
|
||||||
|
bottomPadding: 0
|
||||||
|
|
||||||
property var itemProperties: {"y": editRoot.topPadding,
|
property var itemProperties: {"y": editRoot.topPadding,
|
||||||
"width": editRoot.availableWidth,
|
"width": editRoot.availableWidth,
|
||||||
|
@ -20,6 +23,7 @@ StackView {
|
||||||
color: "#404040" //default background color
|
color: "#404040" //default background color
|
||||||
EditTabView {
|
EditTabView {
|
||||||
id: tab
|
id: tab
|
||||||
|
anchors.fill: parent
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
editRoot.replace(null, tab.itemAt(currentIndex).visualItem,
|
editRoot.replace(null, tab.itemAt(currentIndex).visualItem,
|
||||||
|
|
|
@ -46,8 +46,6 @@ Window {
|
||||||
// type should only consist of logic sized areas, with nothing drawn (although the
|
// type should only consist of logic sized areas, with nothing drawn (although the
|
||||||
// default value for the frame property does include visual decorations)
|
// default value for the frame property does include visual decorations)
|
||||||
property var pane: Item {
|
property var pane: Item {
|
||||||
property bool isScrolling: Qt.binding(function() { return scrollView.contentHeight > scrollView.height; });
|
|
||||||
|
|
||||||
property int contentWidth: scrollView.width
|
property int contentWidth: scrollView.width
|
||||||
property int scrollHeight: scrollView.height
|
property int scrollHeight: scrollView.height
|
||||||
|
|
||||||
|
@ -81,15 +79,16 @@ Window {
|
||||||
contentItem.children: [ content ]
|
contentItem.children: [ content ]
|
||||||
contentHeight: content.height
|
contentHeight: content.height
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
|
property bool isScrolling: (contentHeight - height) > 10 ? true : false
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
anchors.rightMargin: parent.isScrolling ? verticalScrollWidth : 0
|
anchors.rightMargin: isScrolling ? verticalScrollWidth : 0
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.bottomMargin: footerPane.height
|
anchors.bottomMargin: footerPane.height
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
ScrollBar.vertical: ScrollBar {
|
||||||
policy: scrollView.contentHeight > scrollView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
policy: scrollView.isScrolling ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
||||||
parent: scrollView.parent
|
parent: scrollView.parent
|
||||||
anchors.top: scrollView.top
|
anchors.top: scrollView.top
|
||||||
anchors.right: scrollView.right
|
anchors.right: scrollView.right
|
||||||
|
|
Loading…
Reference in a new issue