Files
z-bar-qt/Greeter/Components/ExtraIndicator.qml
T

45 lines
765 B
QML

import ZShell.Config
import QtQuick
import qs.Services
CustomRect {
required property int extra
anchors.margins: 8
anchors.right: parent.right
color: Colors.palette.m3tertiary
implicitHeight: count.implicitHeight + 4 * 2
implicitWidth: count.implicitWidth + 8 * 2
opacity: extra > 0 ? 1 : 0
radius: Tokens.rounding.smallest
scale: extra > 0 ? 1 : 0.5
Behavior on opacity {
Anim {
type: Anim.FastEffects
}
}
Behavior on scale {
Anim {
type: Anim.FastEffects
}
}
Elevation {
anchors.fill: parent
level: 2
opacity: parent.opacity
radius: parent.radius
z: -1
}
CustomText {
id: count
anchors.centerIn: parent
animate: parent.opacity > 0
color: Colors.palette.m3onTertiary
text: qsTr("+%1").arg(parent.extra)
}
}