47 lines
1.4 KiB
QML
47 lines
1.4 KiB
QML
import QtQuick
|
|
import "."
|
|
|
|
// Status chip / telemetry badge: sharp corners, 2px border, a tight 2px
|
|
// offset shadow (deliberately smaller than Surface's, per DESIGN.md's
|
|
// "Status Chips & Telemetry Badges" spec). Children are centered in an
|
|
// internal Row - place them directly as this component's children, same as
|
|
// putting them in a Row.
|
|
Item {
|
|
id: pill
|
|
|
|
property color tint: Theme.colors.outlineVariant
|
|
property bool glow: false
|
|
default property alias content: contentRow.data
|
|
|
|
readonly property color edgeColor: glow ? tint : Theme.colors.crust
|
|
readonly property int offset: 2
|
|
|
|
implicitWidth: contentRow.implicitWidth + Theme.geometry.padding * 2 + offset
|
|
implicitHeight: contentRow.implicitHeight + Theme.geometry.spacing + offset
|
|
height: implicitHeight
|
|
|
|
Rectangle {
|
|
x: pill.offset
|
|
y: pill.offset
|
|
width: pill.width - pill.offset
|
|
height: pill.height - pill.offset
|
|
color: pill.edgeColor
|
|
}
|
|
|
|
Rectangle {
|
|
width: pill.width - pill.offset
|
|
height: pill.height - pill.offset
|
|
color: Theme.colors.surface
|
|
border.width: Theme.geometry.borderWidth
|
|
border.color: pill.edgeColor
|
|
|
|
Behavior on border.color { ColorAnimation { duration: Theme.animation.durationFast } }
|
|
|
|
Row {
|
|
id: contentRow
|
|
anchors.centerIn: parent
|
|
spacing: Theme.geometry.spacing
|
|
}
|
|
}
|
|
}
|