Files
metabuilder/qml/Material/MaterialBadge.qml
johndoe6345789 6e394d7846 style(qt6): 80-char margin enforced — 737 violations → 29 remaining
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>
2026-03-19 15:48:39 +00:00

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
}
}
}