FluentUI/example/qml/page/T_StatusLayout.qml

86 lines
2.3 KiB
QML
Raw Normal View History

2023-08-24 15:50:37 +08:00
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import FluentUI 1.0
2023-08-26 17:20:30 +08:00
import "../component"
2023-04-09 19:29:50 +08:00
FluScrollablePage{
2024-03-09 15:35:48 +08:00
title: qsTr("StatusLayout")
2023-04-09 19:29:50 +08:00
2024-03-29 16:56:09 +08:00
FluFrame{
2023-04-09 19:29:50 +08:00
id:layout_actions
Layout.fillWidth: true
2024-03-29 16:23:16 +08:00
Layout.preferredHeight: 50
padding: 10
2023-04-09 19:29:50 +08:00
RowLayout{
spacing: 14
FluDropDownButton{
id:btn_status_mode
Layout.preferredWidth: 140
text:"Loading"
2023-06-18 13:56:30 +08:00
FluMenuItem{
text:"Loading"
onClicked: {
btn_status_mode.text = text
2024-02-23 12:26:10 +08:00
status_view.statusMode = FluStatusLayoutType.Loading
2023-04-09 19:29:50 +08:00
}
2023-06-18 13:56:30 +08:00
}
FluMenuItem{
text:"Empty"
onClicked: {
btn_status_mode.text = text
2024-02-23 12:26:10 +08:00
status_view.statusMode = FluStatusLayoutType.Empty
2023-06-18 13:56:30 +08:00
}
}
FluMenuItem{
text:"Error"
onClicked: {
btn_status_mode.text = text
2024-02-23 12:26:10 +08:00
status_view.statusMode = FluStatusLayoutType.Error
2023-06-18 13:56:30 +08:00
}
}
FluMenuItem{
text:"Success"
onClicked: {
btn_status_mode.text = text
2024-02-23 12:26:10 +08:00
status_view.statusMode = FluStatusLayoutType.Success
2023-06-18 13:56:30 +08:00
}
}
2023-04-09 19:29:50 +08:00
}
}
}
2024-03-29 16:56:09 +08:00
FluFrame{
2023-04-09 19:29:50 +08:00
Layout.fillWidth: true
Layout.topMargin: 10
2024-03-29 16:23:16 +08:00
Layout.preferredHeight: 380
padding: 10
2024-02-23 12:26:10 +08:00
FluStatusLayout{
2023-04-09 19:29:50 +08:00
id:status_view
anchors.fill: parent
onErrorClicked:{
2024-04-23 00:31:20 +08:00
status_view.statusMode = FluStatusLayoutType.Loading
2023-04-09 19:29:50 +08:00
}
Rectangle {
anchors.fill: parent
2023-11-02 15:33:59 +08:00
color:FluTheme.primaryColor
2023-04-09 19:29:50 +08:00
}
}
}
CodeExpander{
Layout.fillWidth: true
2024-03-29 16:23:16 +08:00
Layout.topMargin: -6
2024-02-23 12:26:10 +08:00
code:'FluStatusLayout{
2023-04-09 19:29:50 +08:00
anchors.fill: parent
2024-02-23 12:26:10 +08:00
statusMode: FluStatusLayoutType.Loading
2023-04-09 19:29:50 +08:00
Rectangle{
anchors.fill: parent
2023-11-02 15:33:59 +08:00
color:FluTheme.primaryColor
2023-04-09 19:29:50 +08:00
}
}'
}
}