This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/doric/resources/scroller.qml

48 lines
985 B
QML
Raw Normal View History

2021-04-08 19:50:39 +08:00
import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.15
import "util.mjs" as Util
2021-04-16 10:06:15 +08:00
ScrollView {
2021-04-08 19:50:39 +08:00
property var wrapper
property var uuid: Util.uuidv4()
2021-04-16 10:06:15 +08:00
property var tag: "Scroller"
2021-04-08 19:50:39 +08:00
2021-04-16 10:06:15 +08:00
ScrollBar.horizontal.policy: ScrollBar.AlwaysOn
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
2021-04-08 19:50:39 +08:00
2021-04-16 10:06:15 +08:00
clip: true
2021-04-08 19:50:39 +08:00
2021-04-16 10:06:15 +08:00
background: Rectangle {
id: bg
color: 'transparent'
2021-04-08 19:50:39 +08:00
}
2021-04-16 10:06:15 +08:00
property var backgroundColor
2021-04-08 19:50:39 +08:00
2021-04-16 10:06:15 +08:00
onBackgroundColorChanged: {
bg.color = backgroundColor
2021-04-08 19:50:39 +08:00
}
2021-04-16 10:06:15 +08:00
onWidthChanged: {
bg.implicitWidth = width
console.log(tag, uuid + " onWidthChanged: " + this.width)
2021-04-08 19:50:39 +08:00
}
2021-04-16 10:06:15 +08:00
onHeightChanged: {
bg.implicitHeight = height
console.log(tag, uuid + " onHeightChanged: " + this.height)
2021-04-08 19:50:39 +08:00
}
2021-04-16 10:06:15 +08:00
// MouseArea {
// anchors.fill: parent
// onClicked: {
// console.log(tag, uuid + " wrapper: " + wrapper)
// mouseAreaBridge.onClick(wrapper)
// }
// }
2021-04-08 19:50:39 +08:00
}