mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 06:14:59 +00:00
update: qt6,frontends,qml (3 files)
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
27
frontends/qt6/qmllib/Material/MaterialBadge.qml
Normal file
27
frontends/qt6/qmllib/Material/MaterialBadge.qml
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user