FluentUI/example/qml/page/T_Badge.qml

132 lines
3.8 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.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
2023-08-26 17:20:30 +08:00
import "../component"
2023-03-20 21:28:12 +08:00
FluScrollablePage{
2024-03-09 15:35:48 +08:00
title: qsTr("Badge")
2023-03-20 21:28:12 +08:00
FluArea{
2023-04-03 09:32:06 +08:00
Layout.fillWidth: true
2023-03-20 21:28:12 +08:00
Layout.topMargin: 20
2024-03-09 15:35:48 +08:00
height: 120
2023-03-20 21:28:12 +08:00
paddings: 10
Column{
spacing: 15
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
2024-03-09 15:35:48 +08:00
right: parent.right
2023-03-20 21:28:12 +08:00
}
FluText{
2024-03-09 22:19:10 +08:00
wrapMode: Text.WrapAnywhere
2024-03-09 15:35:48 +08:00
width: parent.width
text: qsTr("It usually appears in the upper right corner of the notification icon or avatar to display the number of messages that need to be processed")
2023-03-20 21:28:12 +08:00
}
Row{
spacing: 20
Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
2023-06-13 11:48:29 +08:00
topRight: true
showZero: true
2023-03-20 21:28:12 +08:00
count:0
}
}
Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
2023-06-13 11:48:29 +08:00
topRight: true
showZero: true
2023-03-20 21:28:12 +08:00
count:5
}
}
Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
2023-06-13 11:48:29 +08:00
topRight: true
showZero: true
2023-03-20 21:28:12 +08:00
count:50
}
}
Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
2023-06-13 11:48:29 +08:00
topRight: true
showZero: true
2023-03-20 21:28:12 +08:00
count:100
}
}
Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
2023-06-13 11:48:29 +08:00
topRight: true
showZero: true
2023-03-20 21:28:12 +08:00
isDot:true
}
}
Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
2023-06-13 11:48:29 +08:00
topRight: true
showZero: true
2023-03-20 21:28:12 +08:00
count:99
color: Qt.rgba(250/255,173/255,20/255,1)
}
}
Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
2023-06-13 11:48:29 +08:00
topRight: true
showZero: true
2023-03-20 21:28:12 +08:00
count:99
color: Qt.rgba(82/255,196/255,26/255,1)
}
}
}
}
}
2023-04-06 17:32:21 +08:00
CodeExpander{
Layout.fillWidth: true
2023-04-19 17:25:46 +08:00
Layout.topMargin: -1
2023-04-06 17:32:21 +08:00
code:'Rectangle{
width: 40
height: 40
radius: 8
color: Qt.rgba(191/255,191/255,191/255,1)
FluBadge{
count: 100
isDot: false
color: Qt.rgba(82/255,196/255,26/255,1)
}
}'
}
2023-03-20 21:28:12 +08:00
}