fixed notifications popup menu reserving too much space for the next card
This commit is contained in:
@@ -219,6 +219,7 @@ Rectangle {
|
|||||||
t: root.t
|
t: root.t
|
||||||
urgencyColor: root.urgencyColor
|
urgencyColor: root.urgencyColor
|
||||||
urgencyIcon: root.urgencyIcon
|
urgencyIcon: root.urgencyIcon
|
||||||
|
slideFromRight: toastLayer.atRight
|
||||||
onDismissed: (id) => root.removeToast(id)
|
onDismissed: (id) => root.removeToast(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ QtObject {
|
|||||||
|
|
||||||
// ── History popup ──────────────────────────────────────────────────────────
|
// ── History popup ──────────────────────────────────────────────────────────
|
||||||
readonly property color notifHistoryBg: bgPopup
|
readonly property color notifHistoryBg: bgPopup
|
||||||
readonly property color notifHistoryBorder: "#44c19375"
|
readonly property color notifHistoryBorder: borderPopup
|
||||||
readonly property color notifHistoryShadow: "#aa000000"
|
readonly property color notifHistoryShadow: "#aa000000"
|
||||||
readonly property color notifHistoryHover: "#11c19375"
|
readonly property color notifHistoryHover: "#11c19375"
|
||||||
readonly property color notifHistoryEmpty: textDim
|
readonly property color notifHistoryEmpty: textDim
|
||||||
|
|||||||
@@ -25,12 +25,41 @@ Item {
|
|||||||
height: toastCard.height
|
height: toastCard.height
|
||||||
|
|
||||||
property real progressVal: 1.0
|
property real progressVal: 1.0
|
||||||
|
property bool slideFromRight: false
|
||||||
|
|
||||||
|
property real slideX: slideFromRight ? (width + 20) : -(width + 20)
|
||||||
|
|
||||||
|
transform: Translate { id: slideTranslate; x: root.slideX }
|
||||||
|
|
||||||
|
Component.onCompleted: entranceSlide.start()
|
||||||
|
|
||||||
|
NumberAnimation {
|
||||||
|
id: entranceSlide
|
||||||
|
target: slideTranslate; property: "x"
|
||||||
|
from: root.slideX; to: 0
|
||||||
|
duration: 300; easing.type: Easing.OutCubic
|
||||||
|
}
|
||||||
|
|
||||||
|
function triggerDismiss() {
|
||||||
|
if (exitSlide.running) return
|
||||||
|
autoTimer.stop()
|
||||||
|
exitSlide.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
NumberAnimation {
|
||||||
|
id: exitSlide
|
||||||
|
target: slideTranslate; property: "x"
|
||||||
|
to: root.slideX
|
||||||
|
duration: 220; easing.type: Easing.InCubic
|
||||||
|
onStopped: root.dismissed(root.toastId)
|
||||||
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
id: autoTimer
|
||||||
interval: root.timeout
|
interval: root.timeout
|
||||||
running: root.timeout > 0
|
running: root.timeout > 0
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: root.dismissed(root.toastId)
|
onTriggered: root.triggerDismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
NumberAnimation on progressVal {
|
NumberAnimation on progressVal {
|
||||||
@@ -39,23 +68,6 @@ Item {
|
|||||||
running: root.urgency === NotificationUrgency.Low && root.timeout > 0
|
running: root.urgency === NotificationUrgency.Low && root.timeout > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
opacity: 0
|
|
||||||
scale: 0.90
|
|
||||||
Component.onCompleted: {
|
|
||||||
entranceOp.start()
|
|
||||||
entranceSc.start()
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
id: entranceOp; target: root
|
|
||||||
property: "opacity"; from: 0; to: 1
|
|
||||||
duration: 240; easing.type: Easing.OutCubic
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
id: entranceSc; target: root
|
|
||||||
property: "scale"; from: 0.90; to: 1.0
|
|
||||||
duration: 240; easing.type: Easing.OutBack
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: toastCard
|
id: toastCard
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -73,7 +85,7 @@ Item {
|
|||||||
Behavior on border.color { ColorAnimation { duration: 150 } }
|
Behavior on border.color { ColorAnimation { duration: 150 } }
|
||||||
|
|
||||||
HoverHandler { id: cardHover }
|
HoverHandler { id: cardHover }
|
||||||
TapHandler { onTapped: root.dismissed(root.toastId) }
|
TapHandler { onTapped: root.triggerDismiss() }
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: 4
|
width: 4
|
||||||
@@ -139,7 +151,7 @@ Item {
|
|||||||
font.pixelSize: 10
|
font.pixelSize: 10
|
||||||
}
|
}
|
||||||
HoverHandler { id: closeHover; cursorShape: Qt.PointingHandCursor }
|
HoverHandler { id: closeHover; cursorShape: Qt.PointingHandCursor }
|
||||||
TapHandler { onTapped: root.dismissed(root.toastId) }
|
TapHandler { onTapped: root.triggerDismiss() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user