summaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-09 21:48:28 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-09 21:48:28 +1000
commitfbb939403832b0860302f1b400ad021794e1fadb (patch)
tree06e116a06f6ac6845ec04bcfd9f74eef8e7aa2b1 /widgets
parentlock: fix notifs height on startup (diff)
downloadcaelestia-shell-fbb939403832b0860302f1b400ad021794e1fadb.tar.gz
caelestia-shell-fbb939403832b0860302f1b400ad021794e1fadb.tar.bz2
caelestia-shell-fbb939403832b0860302f1b400ad021794e1fadb.zip
notifs: add indicators for offscreen notifs
Diffstat (limited to 'widgets')
-rw-r--r--widgets/ExtraIndicator.qml52
1 files changed, 52 insertions, 0 deletions
diff --git a/widgets/ExtraIndicator.qml b/widgets/ExtraIndicator.qml
new file mode 100644
index 0000000..807cfaf
--- /dev/null
+++ b/widgets/ExtraIndicator.qml
@@ -0,0 +1,52 @@
+import "root:/services"
+import "root:/config"
+import QtQuick
+import QtQuick.Effects
+
+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
+
+ layer.enabled: opacity > 0
+ layer.effect: MultiEffect {
+ shadowEnabled: true
+ blurMax: 10
+ shadowColor: Colours.palette.m3shadow
+ }
+
+ opacity: extra > 0 ? 1 : 0
+ scale: extra > 0 ? 1 : 0.5
+
+ 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
+ }
+ }
+}