mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 14:54:55 +00:00
191 files reformatted across views, components, widgets, hybrid, contexts. New components: CCreateSchemaDialog, CAddFieldDialog, CAdminContentPanel. JS helpers: connBadgeStatus/Text, adminStats, exampleLabels, onLevelClicked. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
47 lines
1.2 KiB
QML
47 lines
1.2 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
|
|
import "MaterialPalette.qml" as MaterialPalette
|
|
|
|
Rectangle {
|
|
id: badge
|
|
property string text: ""
|
|
property url iconSource: ""
|
|
property bool accent: false
|
|
property bool outlined: false
|
|
property bool dense: false
|
|
|
|
height: dense ? 24 : 28
|
|
radius: height / 2
|
|
implicitWidth: label.width + (iconSource.length > 0 ? 32 : 20)
|
|
color: outlined ? "transparent" : (accent ?
|
|
MaterialPalette.secondaryContainer : MaterialPalette.surfaceVariant)
|
|
border.color: outlined ? MaterialPalette.secondary : "transparent"
|
|
border.width: outlined ? 1 : 0
|
|
|
|
RowLayout {
|
|
id: wrapper
|
|
anchors.fill: parent
|
|
anchors.margins: 6
|
|
spacing: iconSource.length > 0 ? 6 : 0
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
Image {
|
|
source: iconSource
|
|
visible: iconSource.length > 0
|
|
width: 16
|
|
height: 16
|
|
fillMode: Image.PreserveAspectFit
|
|
opacity: 0.85
|
|
}
|
|
|
|
Text {
|
|
id: label
|
|
text: badge.text
|
|
font.pixelSize: dense ? 12 : 14
|
|
color: accent
|
|
? MaterialPalette.secondary : MaterialPalette.onSurface
|
|
}
|
|
}
|
|
}
|