T_Badge.qml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. import QtQuick
  2. import QtQuick.Layouts
  3. import QtQuick.Window
  4. import QtQuick.Controls
  5. import FluentUI
  6. import "../component"
  7. FluScrollablePage{
  8. title:"Badge"
  9. leftPadding:10
  10. rightPadding:10
  11. bottomPadding:20
  12. spacing: 0
  13. FluArea{
  14. Layout.fillWidth: true
  15. Layout.topMargin: 20
  16. height: 106
  17. paddings: 10
  18. Column{
  19. spacing: 15
  20. anchors{
  21. verticalCenter: parent.verticalCenter
  22. left: parent.left
  23. }
  24. FluText{
  25. text:"一般出现在通知图标或头像的右上角,用于显示需要处理的消息条数"
  26. }
  27. Row{
  28. spacing: 20
  29. Rectangle{
  30. width: 40
  31. height: 40
  32. radius: 8
  33. color: Qt.rgba(191/255,191/255,191/255,1)
  34. FluBadge{
  35. count:0
  36. }
  37. }
  38. Rectangle{
  39. width: 40
  40. height: 40
  41. radius: 8
  42. color: Qt.rgba(191/255,191/255,191/255,1)
  43. FluBadge{
  44. count:5
  45. }
  46. }
  47. Rectangle{
  48. width: 40
  49. height: 40
  50. radius: 8
  51. color: Qt.rgba(191/255,191/255,191/255,1)
  52. FluBadge{
  53. count:50
  54. }
  55. }
  56. Rectangle{
  57. width: 40
  58. height: 40
  59. radius: 8
  60. color: Qt.rgba(191/255,191/255,191/255,1)
  61. FluBadge{
  62. count:100
  63. }
  64. }
  65. Rectangle{
  66. width: 40
  67. height: 40
  68. radius: 8
  69. color: Qt.rgba(191/255,191/255,191/255,1)
  70. FluBadge{
  71. isDot:true
  72. }
  73. }
  74. Rectangle{
  75. width: 40
  76. height: 40
  77. radius: 8
  78. color: Qt.rgba(191/255,191/255,191/255,1)
  79. FluBadge{
  80. count:99
  81. color: Qt.rgba(250/255,173/255,20/255,1)
  82. }
  83. }
  84. Rectangle{
  85. width: 40
  86. height: 40
  87. radius: 8
  88. color: Qt.rgba(191/255,191/255,191/255,1)
  89. FluBadge{
  90. count:99
  91. color: Qt.rgba(82/255,196/255,26/255,1)
  92. }
  93. }
  94. }
  95. }
  96. }
  97. CodeExpander{
  98. Layout.fillWidth: true
  99. Layout.topMargin: -1
  100. code:'Rectangle{
  101. width: 40
  102. height: 40
  103. radius: 8
  104. color: Qt.rgba(191/255,191/255,191/255,1)
  105. FluBadge{
  106. count: 100
  107. isDot: false
  108. color: Qt.rgba(82/255,196/255,26/255,1)
  109. }
  110. }'
  111. }
  112. }