fix scroll node cannot scroll

This commit is contained in:
王劲鹏
2021-04-16 16:44:08 +08:00
committed by osborn
parent 3207cc2581
commit 7950416ba6
6 changed files with 79 additions and 37 deletions

View File

@@ -11,8 +11,8 @@ ScrollView {
property var tag: "Scroller"
ScrollBar.horizontal.policy: ScrollBar.AlwaysOn
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AlwaysOff
clip: true
@@ -37,11 +37,27 @@ ScrollView {
console.log(tag, uuid + " onHeightChanged: " + this.height)
}
// MouseArea {
// anchors.fill: parent
// onClicked: {
// console.log(tag, uuid + " wrapper: " + wrapper)
// mouseAreaBridge.onClick(wrapper)
// }
// }
onImplicitWidthChanged: {
console.log(tag, uuid + " onImplicitWidthChanged: " + this.implicitWidth)
}
onImplicitHeightChanged: {
console.log(tag, uuid + " onImplicitHeightChanged: " + this.implicitHeight)
}
onContentWidthChanged: {
console.log(tag, uuid + " onContentWidthChanged: " + this.contentWidth)
}
onContentHeightChanged: {
console.log(tag, uuid + " onContentHeightChanged: " + this.contentHeight)
}
MouseArea {
anchors.fill: parent
onClicked: {
console.log(tag, uuid + " wrapper: " + wrapper)
mouseAreaBridge.onClick(wrapper)
}
}
}

View File

@@ -14,8 +14,8 @@ ApplicationWindow {
width: 200
height: 200
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AlwaysOff
ScrollBar.horizontal.policy: ScrollBar.AlwaysOn
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
clip: true
@@ -44,17 +44,14 @@ ApplicationWindow {
console.log(tag, uuid + " onHeightChanged: " + this.height)
}
MouseArea {
anchors.fill: parent
onClicked: {
console.log(tag, uuid + " wrapper: " + wrapper)
mouseAreaBridge.onClick(wrapper)
}
}
Rectangle {
implicitWidth: 400
implicitHeight: 400
Label {
text: "ABC"
font.pixelSize: 224
Label {
text: "ABC"
font.pixelSize: 124
}
}
}
}

View File

@@ -13,6 +13,11 @@ TextArea {
readOnly: true
leftPadding: 0
topPadding: 0
rightPadding: 0
bottomPadding: 0
property int textAlignment: 0
background: Rectangle {