FluentUI/src/controls/FluScrollablePage.qml

67 lines
1.6 KiB
QML
Raw Normal View History

2023-03-25 13:35:21 +08:00
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
2023-03-10 18:08:32 +08:00
Item {
property alias title: text_title.text
default property alias content: container.data
property int spacing : 5
2023-03-28 17:53:46 +08:00
property int leftPadding: 0
property int topPadding: 0
property int rightPadding: 0
property int bottomPadding: 0
2023-03-10 18:08:32 +08:00
2023-03-28 17:53:46 +08:00
id:control
2023-03-27 18:24:35 +08:00
2023-03-10 18:08:32 +08:00
FluText{
id:text_title
fontStyle: FluText.TitleLarge
2023-03-29 15:43:23 +08:00
visible: text !== ""
height: visible?implicitHeight:0
2023-03-28 17:53:46 +08:00
anchors{
top: parent.top
topMargin: control.topPadding
left: parent.left
right: parent.right
leftMargin: control.leftPadding
rightMargin: control.rightPadding
}
2023-03-10 18:08:32 +08:00
}
2023-03-14 18:23:12 +08:00
Flickable{
2023-03-28 17:53:46 +08:00
id:flickview
2023-03-10 18:08:32 +08:00
clip: true
2023-03-28 17:53:46 +08:00
anchors{
left: parent.left
right: parent.right
top: text_title.bottom
bottom: parent.bottom
bottomMargin: control.bottomPadding
}
2023-03-10 18:08:32 +08:00
contentWidth: parent.width
2023-03-14 18:23:12 +08:00
contentHeight: container.height
2023-03-28 17:53:46 +08:00
ScrollBar.vertical: FluScrollBar {
}
2023-03-10 18:08:32 +08:00
anchors{
top: text_title.bottom
bottom: parent.bottom
}
ColumnLayout{
id:container
2023-03-28 17:53:46 +08:00
spacing: control.spacing
clip: true
anchors{
left: parent.left
right: parent.right
top: parent.top
leftMargin: control.leftPadding
rightMargin: control.rightPadding
}
2023-03-10 18:08:32 +08:00
width: parent.width
}
}
}