49 lines
1,006 B
QML
49 lines
1,006 B
QML
import qs.services
|
|
import qs.config
|
|
import QtQuick
|
|
|
|
CustomRect {
|
|
required property int extra
|
|
|
|
anchors.right: parent.right
|
|
anchors.margins: 12
|
|
|
|
color: Config.colors.inactive
|
|
radius: 12
|
|
|
|
implicitWidth: count.implicitWidth + 20
|
|
implicitHeight: count.implicitHeight + 10
|
|
|
|
opacity: extra > 0 ? 1 : 0
|
|
scale: extra > 0 ? 1 : 0.5
|
|
|
|
Elevation {
|
|
anchors.fill: parent
|
|
radius: parent.radius
|
|
opacity: parent.opacity
|
|
z: -1
|
|
level: 2
|
|
}
|
|
|
|
CustomText {
|
|
id: count
|
|
|
|
anchors.centerIn: parent
|
|
animate: false
|
|
text: qsTr("+%1").arg(parent.extra)
|
|
color: Config.colors.secondary
|
|
}
|
|
|
|
Behavior on opacity {
|
|
Anim {
|
|
duration: Config.anim.durations.expressiveFastSpatial
|
|
}
|
|
}
|
|
|
|
Behavior on scale {
|
|
Anim {
|
|
duration: Config.anim.durations.expressiveFastSpatial
|
|
easing.bezierCurve: Config.anim.curves.expressiveFastSpatial
|
|
}
|
|
}
|
|
}
|