mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
Suppress niri toasts on theme changes
This commit is contained in:
@@ -869,7 +869,7 @@ Singleton {
|
||||
|
||||
onExited: exitCode => {
|
||||
if (exitCode === 0) {
|
||||
if (typeof ToastService !== "undefined") {
|
||||
if (typeof ToastService !== "undefined" && typeof NiriService !== "undefined" && !NiriService.matugenSuppression) {
|
||||
ToastService.showInfo("GTK colors applied successfully")
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -30,6 +30,7 @@ Singleton {
|
||||
property bool hasInitialConnection: false
|
||||
property bool suppressConfigToast: true
|
||||
property bool suppressNextConfigToast: false
|
||||
property bool matugenSuppression: false
|
||||
|
||||
readonly property string socketPath: Quickshell.env("NIRI_SOCKET")
|
||||
|
||||
@@ -346,10 +347,12 @@ Singleton {
|
||||
if (ToastService.toastVisible && ToastService.currentLevel === ToastService.levelError) {
|
||||
ToastService.hideToast()
|
||||
}
|
||||
if (hasInitialConnection && !suppressConfigToast && !suppressNextConfigToast) {
|
||||
if (hasInitialConnection && !suppressConfigToast && !suppressNextConfigToast && !matugenSuppression) {
|
||||
ToastService.showInfo("niri: config reloaded")
|
||||
} else if (suppressNextConfigToast) {
|
||||
suppressNextConfigToast = false
|
||||
suppressResetTimer.stop()
|
||||
}
|
||||
suppressNextConfigToast = false
|
||||
}
|
||||
|
||||
if (!hasInitialConnection) {
|
||||
@@ -496,7 +499,8 @@ Singleton {
|
||||
}
|
||||
|
||||
function suppressNextToast() {
|
||||
suppressNextConfigToast = true
|
||||
matugenSuppression = true
|
||||
suppressResetTimer.restart()
|
||||
}
|
||||
|
||||
function findNiriWindow(toplevel) {
|
||||
@@ -595,4 +599,10 @@ Singleton {
|
||||
interval: 3000
|
||||
onTriggered: root.suppressConfigToast = false
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: suppressResetTimer
|
||||
interval: 2000
|
||||
onTriggered: root.matugenSuppression = false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user