Another possible toast fix
This commit is contained in:
parent
e3154fb9a5
commit
b8b660db08
1 changed files with 12 additions and 4 deletions
|
|
@ -17,6 +17,10 @@ Variants {
|
||||||
readonly property real scaling: ScalingService.scale(screen)
|
readonly property real scaling: ScalingService.scale(screen)
|
||||||
screen: modelData
|
screen: modelData
|
||||||
|
|
||||||
|
// Only show on screens that have notifications enabled
|
||||||
|
visible: modelData ? (Settings.data.notifications.monitors.includes(modelData.name)
|
||||||
|
|| (Settings.data.notifications.monitors.length === 0)) : false
|
||||||
|
|
||||||
// Position based on bar location, like Notification popup does
|
// Position based on bar location, like Notification popup does
|
||||||
anchors {
|
anchors {
|
||||||
top: Settings.data.bar.position === "top"
|
top: Settings.data.bar.position === "top"
|
||||||
|
|
@ -51,11 +55,15 @@ Variants {
|
||||||
hiddenY: Settings.data.bar.position === "top" ? -toast.height - 20 : toast.height + 20
|
hiddenY: Settings.data.bar.position === "top" ? -toast.height - 20 : toast.height + 20
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// Register this toast with the service
|
// Only register toasts for screens that have notifications enabled
|
||||||
ToastService.allToasts.push(toast)
|
if (modelData ? (Settings.data.notifications.monitors.includes(modelData.name)
|
||||||
|
|| (Settings.data.notifications.monitors.length === 0)) : false) {
|
||||||
|
// Register this toast with the service
|
||||||
|
ToastService.allToasts.push(toast)
|
||||||
|
|
||||||
// Connect dismissal signal
|
// Connect dismissal signal
|
||||||
toast.dismissed.connect(ToastService.onToastDismissed)
|
toast.dismissed.connect(ToastService.onToastDismissed)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue