summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-26 22:32:25 +0800
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-26 22:32:25 +0800
commitf305c3f3f64befbd92c92f5ced43dfa9ced3d309 (patch)
tree25196e307bed97607e12508b29b27caa197204b4 /modules
parentdashboard: fix tab indicator animation (diff)
downloadcaelestia-shell-f305c3f3f64befbd92c92f5ced43dfa9ced3d309.tar.gz
caelestia-shell-f305c3f3f64befbd92c92f5ced43dfa9ced3d309.tar.bz2
caelestia-shell-f305c3f3f64befbd92c92f5ced43dfa9ced3d309.zip
notifs: better height
Get blocked by other panels from the right side (osd and session) Limit max height to screen height
Diffstat (limited to 'modules')
-rw-r--r--modules/drawers/Panels.qml3
-rw-r--r--modules/notifications/Content.qml27
-rw-r--r--modules/notifications/Notification.qml3
3 files changed, 28 insertions, 5 deletions
diff --git a/modules/drawers/Panels.qml b/modules/drawers/Panels.qml
index 9bde4b2..db97362 100644
--- a/modules/drawers/Panels.qml
+++ b/modules/drawers/Panels.qml
@@ -1,3 +1,4 @@
+import "root:/services"
import "root:/config"
import "root:/modules/osd" as Osd
import "root:/modules/notifications" as Notifications
@@ -22,6 +23,8 @@ Item {
anchors.fill: parent
anchors.margins: BorderConfig.thickness
+ Component.onCompleted: Visibilities.panels[screen] = this
+
Osd.Wrapper {
id: osd
diff --git a/modules/notifications/Content.qml b/modules/notifications/Content.qml
index 71cf0cf..9a73bc8 100644
--- a/modules/notifications/Content.qml
+++ b/modules/notifications/Content.qml
@@ -14,7 +14,7 @@ Item {
anchors.right: parent.right
implicitWidth: NotifsConfig.sizes.width + root.padding * 2
- implicitHeight: list.height + root.padding * 2
+ implicitHeight: list.implicitHeight + root.padding * 2
ListView {
id: list
@@ -31,13 +31,32 @@ Item {
implicitHeight: {
let height = (count - 1) * spacing;
for (let i = 0; i < count; i++)
- height += itemAtIndex(i).nonAnimHeight;
- return Math.max(61, height);
+ height += itemAtIndex(i)?.nonAnimHeight ?? 0;
+
+ const screen = QsWindow.window?.screen;
+ const visibilities = Visibilities.screens[screen];
+ const panel = Visibilities.panels[screen];
+ if (visibilities && panel) {
+ if (visibilities.osd) {
+ const h = panel.osd.y - BorderConfig.rounding * 2;
+ if (height > h)
+ height = h;
+ }
+
+ if (visibilities.session) {
+ const h = panel.session.y - BorderConfig.rounding * 2;
+ if (height > h)
+ height = h;
+ }
+ }
+
+ return Math.max(61, Math.min(screen?.height - root.padding * 2 - BorderConfig.thickness * 2, height));
}
orientation: Qt.Vertical
spacing: Appearance.spacing.smaller
- interactive: false
+ cacheBuffer: QsWindow.window?.screen.height ?? 0
+ clip: true
delegate: ClippingRectangle {
id: wrapper
diff --git a/modules/notifications/Notification.qml b/modules/notifications/Notification.qml
index d8c8ba7..039b519 100644
--- a/modules/notifications/Notification.qml
+++ b/modules/notifications/Notification.qml
@@ -33,6 +33,7 @@ StyledRect {
hoverEnabled: true
cursorShape: pressed ? Qt.ClosedHandCursor : undefined
acceptedButtons: Qt.LeftButton | Qt.MiddleButton
+ preventStealing: true
onEntered: root.modelData?.timer.stop()
onExited: root.modelData?.timer.start()
@@ -461,7 +462,7 @@ StyledRect {
TextMetrics {
id: actionTextMetrics
- text: modelData?.text
+ text: modelData?.text ?? ""
font.family: actionText.font.family
font.pointSize: actionText.font.pointSize
elide: Text.ElideRight