notifs: better sliding
Wrap with clippingrect so x doesnt reset when element is added/removed Also clippingrect rounds the ends when sliding
This commit is contained in:
parent
22a99154b7
commit
c64e602725
2 changed files with 18 additions and 10 deletions
|
|
@ -2,6 +2,7 @@ import "root:/widgets"
|
||||||
import "root:/services"
|
import "root:/services"
|
||||||
import "root:/config"
|
import "root:/config"
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import Quickshell.Widgets
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
@ -34,20 +35,25 @@ Item {
|
||||||
return Math.max(61, height);
|
return Math.max(61, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
clip: true
|
|
||||||
orientation: Qt.Vertical
|
orientation: Qt.Vertical
|
||||||
spacing: Appearance.spacing.smaller
|
spacing: Appearance.spacing.smaller
|
||||||
interactive: false
|
interactive: false
|
||||||
|
|
||||||
delegate: Notification {}
|
delegate: ClippingRectangle {
|
||||||
|
id: wrapper
|
||||||
|
|
||||||
add: Transition {
|
required property Notifs.Notif modelData
|
||||||
Anim {
|
readonly property alias nonAnimHeight: notif.nonAnimHeight
|
||||||
property: "x"
|
|
||||||
from: NotifsConfig.sizes.width
|
color: "transparent"
|
||||||
to: 0
|
radius: notif.radius
|
||||||
duration: Appearance.anim.durations.large
|
implicitWidth: notif.width
|
||||||
easing.bezierCurve: Appearance.anim.curves.emphasizedDecel
|
implicitHeight: notif.height
|
||||||
|
|
||||||
|
Notification {
|
||||||
|
id: notif
|
||||||
|
|
||||||
|
modelData: wrapper.modelData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,14 @@ StyledRect {
|
||||||
readonly property int nonAnimHeight: summary.implicitHeight + (root.expanded ? appName.height + body.height + actions.height + actions.anchors.topMargin : bodyPreview.height) + inner.anchors.margins * 2
|
readonly property int nonAnimHeight: summary.implicitHeight + (root.expanded ? appName.height + body.height + actions.height + actions.anchors.topMargin : bodyPreview.height) + inner.anchors.margins * 2
|
||||||
property bool expanded
|
property bool expanded
|
||||||
|
|
||||||
clip: true
|
|
||||||
color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainer
|
color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainer
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
implicitWidth: NotifsConfig.sizes.width
|
implicitWidth: NotifsConfig.sizes.width
|
||||||
implicitHeight: inner.height
|
implicitHeight: inner.height
|
||||||
|
|
||||||
|
x: NotifsConfig.sizes.width
|
||||||
|
Component.onCompleted: x = 0
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
property int startY
|
property int startY
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue