update: qt6,frontends,qml (3 files)

This commit is contained in:
2025-12-26 06:42:12 +00:00
parent 53c3e4440b
commit cc07cdb758
3 changed files with 45 additions and 0 deletions

View File

@@ -112,5 +112,22 @@ ApplicationWindow {
}
}
}
ColumnLayout {
spacing: 10
Text {
text: "Badge samples"
font.pixelSize: 18
color: Material.MaterialPalette.onSurface
font.bold: true
}
RowLayout {
spacing: 10
Material.MaterialBadge { text: "alpha"; accent: true }
Material.MaterialBadge { text: "stable"; dense: true }
Material.MaterialBadge { text: "live"; outlined: true }
}
}
}
}

View File

@@ -0,0 +1,27 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import "MaterialPalette.qml" as MaterialPalette
Rectangle {
id: badge
property string text: ""
property bool accent: false
property bool outlined: false
property bool dense: false
height: dense ? 24 : 28
radius: height / 2
implicitWidth: label.width + 20
color: outlined ? "transparent" : (accent ? MaterialPalette.secondaryContainer : MaterialPalette.surfaceVariant)
border.color: outlined ? MaterialPalette.secondary : "transparent"
border.width: outlined ? 1 : 0
Text {
id: label
anchors.centerIn: parent
text: badge.text
font.pixelSize: dense ? 12 : 14
color: accent ? MaterialPalette.secondary : MaterialPalette.onSurface
}
}

View File

@@ -6,3 +6,4 @@ MaterialTextField 1.0 MaterialTextField.qml
MaterialChip 1.0 MaterialChip.qml
MaterialSurface 1.0 MaterialSurface.qml
MaterialDivider 1.0 MaterialDivider.qml
MaterialBadge 1.0 MaterialBadge.qml