summaryrefslogtreecommitdiff
path: root/modules/notifications
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 /modules/notifications
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 'modules/notifications')
-rw-r--r--modules/notifications/Content.qml3
-rw-r--r--modules/notifications/Notification.qml67
2 files changed, 36 insertions, 34 deletions
diff --git a/modules/notifications/Content.qml b/modules/notifications/Content.qml
index a41933d..2ece7f4 100644
--- a/modules/notifications/Content.qml
+++ b/modules/notifications/Content.qml
@@ -1,4 +1,5 @@
-import qs.widgets
+import qs.components.containers
+import qs.components.widgets
import qs.services
import qs.config
import Quickshell
diff --git a/modules/notifications/Notification.qml b/modules/notifications/Notification.qml
index f9940b3..cdb6804 100644
--- a/modules/notifications/Notification.qml
+++ b/modules/notifications/Notification.qml
@@ -1,6 +1,7 @@
pragma ComponentBehavior: Bound
-import qs.widgets
+import qs.components
+import qs.components.effects
import qs.services
import qs.config
import qs.utils
@@ -441,49 +442,49 @@ StyledRect {
}
}
}
+ }
- component Action: StyledRect {
- id: action
+ component Action: StyledRect {
+ id: action
- required property var modelData
+ required property var modelData
- radius: Appearance.rounding.full
- color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3secondary : Colours.palette.m3surfaceContainerHigh
+ radius: Appearance.rounding.full
+ color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3secondary : Colours.palette.m3surfaceContainerHigh
- Layout.preferredWidth: actionText.width + Appearance.padding.normal * 2
- Layout.preferredHeight: actionText.height + Appearance.padding.small * 2
- implicitWidth: actionText.width + Appearance.padding.normal * 2
- implicitHeight: actionText.height + Appearance.padding.small * 2
+ Layout.preferredWidth: actionText.width + Appearance.padding.normal * 2
+ Layout.preferredHeight: actionText.height + Appearance.padding.small * 2
+ implicitWidth: actionText.width + Appearance.padding.normal * 2
+ implicitHeight: actionText.height + Appearance.padding.small * 2
- StateLayer {
- radius: Appearance.rounding.full
- color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3onSecondary : Colours.palette.m3onSurface
+ StateLayer {
+ radius: Appearance.rounding.full
+ color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3onSecondary : Colours.palette.m3onSurface
- function onClicked(): void {
- action.modelData.invoke();
- }
+ function onClicked(): void {
+ action.modelData.invoke();
}
+ }
- StyledText {
- id: actionText
+ StyledText {
+ id: actionText
- anchors.centerIn: parent
- text: actionTextMetrics.elidedText
- color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3onSecondary : Colours.palette.m3onSurfaceVariant
- font.pointSize: Appearance.font.size.small
- }
+ anchors.centerIn: parent
+ text: actionTextMetrics.elidedText
+ color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3onSecondary : Colours.palette.m3onSurfaceVariant
+ font.pointSize: Appearance.font.size.small
+ }
- TextMetrics {
- id: actionTextMetrics
+ TextMetrics {
+ id: actionTextMetrics
- text: action.modelData.text
- font.family: actionText.font.family
- font.pointSize: actionText.font.pointSize
- elide: Text.ElideRight
- elideWidth: {
- const numActions = root.modelData.actions.length + 1;
- return (inner.width - actions.spacing * (numActions - 1)) / numActions - Appearance.padding.normal * 2;
- }
+ text: action.modelData.text
+ font.family: actionText.font.family
+ font.pointSize: actionText.font.pointSize
+ elide: Text.ElideRight
+ elideWidth: {
+ const numActions = root.modelData.actions.length + 1;
+ return (inner.width - actions.spacing * (numActions - 1)) / numActions - Appearance.padding.normal * 2;
}
}
}