summaryrefslogtreecommitdiff
path: root/components/widgets
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-04 22:45:15 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-04 22:45:15 +1000
commitc5381c5194adf97c240acb98eb4c4c950633b325 (patch)
tree52b18eb1771ec6708c86f11d786684f03b8a7c48 /components/widgets
parentdashboard: display correct temp units (diff)
downloadcaelestia-shell-c5381c5194adf97c240acb98eb4c4c950633b325.tar.gz
caelestia-shell-c5381c5194adf97c240acb98eb4c4c950633b325.tar.bz2
caelestia-shell-c5381c5194adf97c240acb98eb4c4c950633b325.zip
internal: refactor widgets folder
Split into subdirs and rename to components
Diffstat (limited to 'components/widgets')
-rw-r--r--components/widgets/ExtraIndicator.qml54
1 files changed, 54 insertions, 0 deletions
diff --git a/components/widgets/ExtraIndicator.qml b/components/widgets/ExtraIndicator.qml
new file mode 100644
index 0000000..6034b33
--- /dev/null
+++ b/components/widgets/ExtraIndicator.qml
@@ -0,0 +1,54 @@
+import ".."
+import "../effects"
+import qs.services
+import qs.config
+import QtQuick
+
+StyledRect {
+ required property int extra
+
+ anchors.right: parent.right
+ anchors.margins: Appearance.padding.normal
+
+ color: Colours.palette.m3tertiary
+ radius: Appearance.rounding.small
+
+ implicitWidth: count.implicitWidth + Appearance.padding.normal * 2
+ implicitHeight: count.implicitHeight + Appearance.padding.small * 2
+
+ 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
+ }
+
+ StyledText {
+ id: count
+
+ anchors.centerIn: parent
+ animate: parent.opacity > 0
+ text: qsTr("+%1").arg(parent.extra)
+ color: Colours.palette.m3onTertiary
+ }
+
+ Behavior on opacity {
+ NumberAnimation {
+ duration: Appearance.anim.durations.expressiveFastSpatial
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
+ }
+ }
+
+ Behavior on scale {
+ NumberAnimation {
+ duration: Appearance.anim.durations.expressiveFastSpatial
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.expressiveFastSpatial
+ }
+ }
+}