diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-21 17:33:28 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-21 17:33:28 +1000 |
| commit | 61b21f389f90c2d6c7ed9cd1b206b6a31ae93d86 (patch) | |
| tree | ee4808009110c6e85540b4b6d0f0b947b3f80d25 /modules/utilities/toasts | |
| parent | utilities: add toasts (diff) | |
| download | caelestia-shell-61b21f389f90c2d6c7ed9cd1b206b6a31ae93d86.tar.gz caelestia-shell-61b21f389f90c2d6c7ed9cd1b206b6a31ae93d86.tar.bz2 caelestia-shell-61b21f389f90c2d6c7ed9cd1b206b6a31ae93d86.zip | |
feat: add battery warnings
Closes #73
Closes #117
Diffstat (limited to 'modules/utilities/toasts')
| -rw-r--r-- | modules/utilities/toasts/ToastItem.qml | 3 | ||||
| -rw-r--r-- | modules/utilities/toasts/Toasts.qml | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/modules/utilities/toasts/ToastItem.qml b/modules/utilities/toasts/ToastItem.qml index fa3aa18..481b831 100644 --- a/modules/utilities/toasts/ToastItem.qml +++ b/modules/utilities/toasts/ToastItem.qml @@ -107,10 +107,12 @@ StyledRect { return Colours.palette.m3onSurface; } font.pointSize: Appearance.font.size.normal + elide: Text.ElideRight } StyledText { Layout.fillWidth: true + textFormat: Text.StyledText text: root.modelData.message color: { if (root.modelData.type === Toast.Success) @@ -122,6 +124,7 @@ StyledRect { return Colours.palette.m3onSurface; } opacity: 0.8 + elide: Text.ElideRight } } } diff --git a/modules/utilities/toasts/Toasts.qml b/modules/utilities/toasts/Toasts.qml index c23790d..c9a8d4d 100644 --- a/modules/utilities/toasts/Toasts.qml +++ b/modules/utilities/toasts/Toasts.qml @@ -58,6 +58,11 @@ Item { return index >= Config.utilities.maxToasts + extraHidden; } + onPreviewHiddenChanged: { + if (initAnim.running && previewHidden) + initAnim.stop(); + } + opacity: modelData.closed || previewHidden ? 0 : 1 scale: modelData.closed || previewHidden ? 0.7 : 1 @@ -83,6 +88,8 @@ Item { Component.onCompleted: modelData.lock(this) Anim { + id: initAnim + Component.onCompleted: running = !toast.previewHidden target: toast |