FluentUI/example/qml-Qt6/page/T_InfoBar.qml

73 lines
2.0 KiB
QML
Raw Normal View History

2023-08-24 15:50:37 +08:00
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import FluentUI
2024-01-25 17:26:50 +08:00
import "../component"
2023-08-24 15:50:37 +08:00
FluScrollablePage{
2024-03-09 15:35:48 +08:00
title: qsTr("InfoBar")
2023-08-24 15:50:37 +08:00
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
2023-09-15 19:11:55 +08:00
height: 270
2023-08-24 15:50:37 +08:00
paddings: 10
ColumnLayout{
spacing: 14
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
FluButton{
2024-03-09 15:35:48 +08:00
text: qsTr("Info")
2023-08-24 15:50:37 +08:00
onClicked: {
2024-03-09 15:35:48 +08:00
showInfo(qsTr("This is an InfoBar in the Info Style"))
2023-08-24 15:50:37 +08:00
}
}
FluButton{
2024-03-09 15:35:48 +08:00
text: qsTr("Warning")
2023-08-24 15:50:37 +08:00
onClicked: {
2024-03-09 15:35:48 +08:00
showWarning(qsTr("This is an InfoBar in the Warning Style"))
2023-08-24 15:50:37 +08:00
}
}
FluButton{
text:"Error"
onClicked: {
2024-03-09 15:35:48 +08:00
showError(qsTr("This is an InfoBar in the Error Style"))
2023-08-24 15:50:37 +08:00
}
}
FluButton{
text:"Success"
onClicked: {
2024-03-09 15:35:48 +08:00
showSuccess(qsTr("This is an InfoBar in the Success Style"))
2023-08-24 15:50:37 +08:00
}
}
2023-09-15 19:11:55 +08:00
FluButton{
2024-03-09 15:35:48 +08:00
text: qsTr("InfoBar that needs to be turned off manually")
2023-09-15 19:11:55 +08:00
onClicked: {
2024-03-15 12:19:38 +08:00
showInfo(qsTr("This is an InfoBar in the Info Style"),0,qsTr("Manual shutdown is supported"))
2023-09-15 19:11:55 +08:00
}
}
2023-08-24 15:50:37 +08:00
FluButton{
text:"Loading"
onClicked: {
2024-03-13 17:54:11 +08:00
showLoading()
2023-08-24 15:50:37 +08:00
}
}
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
2024-03-09 15:35:48 +08:00
code:'showInfo(qsTr("This is an InfoBar in the Info Style"))
2023-08-24 15:50:37 +08:00
2024-03-09 15:35:48 +08:00
showWarning(qsTr("This is an InfoBar in the Warning Style"))
2023-08-24 15:50:37 +08:00
2024-03-09 15:35:48 +08:00
showError(qsTr("This is an InfoBar in the Error Style"))
2023-08-24 15:50:37 +08:00
2024-03-09 15:35:48 +08:00
showSuccess(qsTr("This is an InfoBar in the Success Style"))'
2023-08-24 15:50:37 +08:00
}
}