diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-15 18:08:45 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-15 18:08:45 +1000 |
| commit | 96429160c30ba5f6dcd25c8e6a181221195c41d8 (patch) | |
| tree | 6f95bac8f3056abae67c04ae612b574ce1c37286 /modules/notifications/Notification.qml | |
| parent | internal: properly fix beat detector (diff) | |
| download | caelestia-shell-96429160c30ba5f6dcd25c8e6a181221195c41d8.tar.gz caelestia-shell-96429160c30ba5f6dcd25c8e6a181221195c41d8.tar.bz2 caelestia-shell-96429160c30ba5f6dcd25c8e6a181221195c41d8.zip | |
feat: user config file
Config file at `~/.config/caelestia/shell.json`
Diffstat (limited to 'modules/notifications/Notification.qml')
| -rw-r--r-- | modules/notifications/Notification.qml | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/notifications/Notification.qml b/modules/notifications/Notification.qml index 848eac4..ebc5ce6 100644 --- a/modules/notifications/Notification.qml +++ b/modules/notifications/Notification.qml @@ -20,10 +20,10 @@ StyledRect { color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainer radius: Appearance.rounding.normal - implicitWidth: NotifsConfig.sizes.width + implicitWidth: Config.notifs.sizes.width implicitHeight: inner.implicitHeight - x: NotifsConfig.sizes.width + x: Config.notifs.sizes.width Component.onCompleted: x = 0 RetainableLock { @@ -52,7 +52,7 @@ StyledRect { root.modelData.notification.dismiss(); } onReleased: event => { - if (Math.abs(root.x) < NotifsConfig.sizes.width * NotifsConfig.clearThreshold) + if (Math.abs(root.x) < Config.notifs.sizes.width * Config.notifs.clearThreshold) root.x = 0; else root.modelData.popup = false; @@ -60,12 +60,12 @@ StyledRect { onPositionChanged: event => { if (pressed) { const diffY = event.y - startY; - if (Math.abs(diffY) > NotifsConfig.expandThreshold) + if (Math.abs(diffY) > Config.notifs.expandThreshold) root.expanded = diffY > 0; } } onClicked: event => { - if (!NotifsConfig.actionOnClick || event.button !== Qt.LeftButton) + if (!Config.notifs.actionOnClick || event.button !== Qt.LeftButton) return; const actions = root.modelData.actions; @@ -107,14 +107,14 @@ StyledRect { anchors.left: parent.left anchors.top: parent.top - width: NotifsConfig.sizes.image - height: NotifsConfig.sizes.image + width: Config.notifs.sizes.image + height: Config.notifs.sizes.image visible: root.hasImage || root.hasAppIcon sourceComponent: ClippingRectangle { radius: Appearance.rounding.full - implicitWidth: NotifsConfig.sizes.image - implicitHeight: NotifsConfig.sizes.image + implicitWidth: Config.notifs.sizes.image + implicitHeight: Config.notifs.sizes.image Image { anchors.fill: parent @@ -140,8 +140,8 @@ StyledRect { sourceComponent: StyledRect { radius: Appearance.rounding.full color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3error : root.modelData.urgency === NotificationUrgency.Low ? Colours.palette.m3surfaceContainerHighest : Colours.palette.m3tertiaryContainer - implicitWidth: root.hasImage ? NotifsConfig.sizes.badge : NotifsConfig.sizes.image - implicitHeight: root.hasImage ? NotifsConfig.sizes.badge : NotifsConfig.sizes.image + implicitWidth: root.hasImage ? Config.notifs.sizes.badge : Config.notifs.sizes.image + implicitHeight: root.hasImage ? Config.notifs.sizes.badge : Config.notifs.sizes.image Loader { id: icon |