mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
* feat(settings): add option to suppress config reload toast (#2730) Add a toggle in Settings → Compositor Layout to disable the 'config reloaded' toast for Niri and MangoWC compositors. Session setting showConfigReloadToast defaults to true. * chore: update settings search index for config reload toast * refactor(settings): rename 'Compositor Notifications' to 'Compositor Toasts' * fix(settings): reuse existing I18n.tr('Notifications') translation
This commit is contained in:
@@ -224,6 +224,7 @@ Singleton {
|
|||||||
property string niriOverviewLastMode: "apps"
|
property string niriOverviewLastMode: "apps"
|
||||||
property string settingsSidebarExpandedIds: ","
|
property string settingsSidebarExpandedIds: ","
|
||||||
property string settingsSidebarCollapsedIds: ","
|
property string settingsSidebarCollapsedIds: ","
|
||||||
|
property bool showConfigReloadToast: true
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
|||||||
@@ -98,7 +98,8 @@ var SPEC = {
|
|||||||
niriOverviewLastMode: { def: "apps" },
|
niriOverviewLastMode: { def: "apps" },
|
||||||
|
|
||||||
settingsSidebarExpandedIds: { def: "," },
|
settingsSidebarExpandedIds: { def: "," },
|
||||||
settingsSidebarCollapsedIds: { def: "," }
|
settingsSidebarCollapsedIds: { def: "," },
|
||||||
|
showConfigReloadToast: { def: true }
|
||||||
};
|
};
|
||||||
|
|
||||||
function getValidKeys() {
|
function getValidKeys() {
|
||||||
|
|||||||
@@ -267,6 +267,24 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsCard {
|
||||||
|
width: parent.width
|
||||||
|
tags: ["compositor", "toast"]
|
||||||
|
title: I18n.tr("Notifications")
|
||||||
|
settingKey: "compositorNotifications"
|
||||||
|
iconName: "notifications"
|
||||||
|
visible: CompositorService.isNiri || CompositorService.isMango
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
tags: ["compositor", "toast", "reload"]
|
||||||
|
settingKey: "showConfigReloadToast"
|
||||||
|
text: I18n.tr("Show \"config reloaded\" Toast")
|
||||||
|
description: I18n.tr("Show a toast when the compositor config is reloaded")
|
||||||
|
checked: SessionData.showConfigReloadToast
|
||||||
|
onToggled: checked => SessionData.showConfigReloadToast = checked
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
tags: ["niri", "layout", "gaps", "radius", "window", "border"]
|
tags: ["niri", "layout", "gaps", "radius", "window", "border"]
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ Singleton {
|
|||||||
function reloadConfig(showToast, suppressWatch) {
|
function reloadConfig(showToast, suppressWatch) {
|
||||||
if (!CompositorService.isMango || !root.available)
|
if (!CompositorService.isMango || !root.available)
|
||||||
return;
|
return;
|
||||||
const shouldShowToast = showToast !== false;
|
const shouldShowToast = showToast !== false && SessionData.showConfigReloadToast;
|
||||||
const shouldSuppressWatch = suppressWatch !== false;
|
const shouldSuppressWatch = suppressWatch !== false;
|
||||||
if (shouldSuppressWatch)
|
if (shouldSuppressWatch)
|
||||||
suppressWatchedConfigReloads(1500);
|
suppressWatchedConfigReloads(1500);
|
||||||
|
|||||||
@@ -633,7 +633,7 @@ Singleton {
|
|||||||
configGenerationAction.schedule();
|
configGenerationAction.schedule();
|
||||||
configReloaded();
|
configReloaded();
|
||||||
|
|
||||||
if (hasInitialConnection && !suppressConfigToast && !suppressNextConfigToast && !matugenSuppression) {
|
if (hasInitialConnection && !suppressConfigToast && !suppressNextConfigToast && !matugenSuppression && SessionData.showConfigReloadToast) {
|
||||||
ToastService.showInfo(I18n.tr("niri: config reloaded"), "", "", "niri-config");
|
ToastService.showInfo(I18n.tr("niri: config reloaded"), "", "", "niri-config");
|
||||||
} else if (suppressNextConfigToast) {
|
} else if (suppressNextConfigToast) {
|
||||||
suppressNextConfigToast = false;
|
suppressNextConfigToast = false;
|
||||||
|
|||||||
@@ -9105,6 +9105,32 @@
|
|||||||
],
|
],
|
||||||
"description": "Space between windows"
|
"description": "Space between windows"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"section": "compositorNotifications",
|
||||||
|
"label": "Notifications",
|
||||||
|
"tabIndex": 37,
|
||||||
|
"category": "Personalization",
|
||||||
|
"keywords": [
|
||||||
|
"alert",
|
||||||
|
"alerts",
|
||||||
|
"appearance",
|
||||||
|
"compositor",
|
||||||
|
"config",
|
||||||
|
"custom",
|
||||||
|
"customize",
|
||||||
|
"notif",
|
||||||
|
"notifications",
|
||||||
|
"notifs",
|
||||||
|
"personal",
|
||||||
|
"personalization",
|
||||||
|
"reloaded",
|
||||||
|
"show",
|
||||||
|
"toast"
|
||||||
|
],
|
||||||
|
"icon": "notifications",
|
||||||
|
"description": "Show a toast when the compositor config is reloaded",
|
||||||
|
"conditionKey": "isNiri"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"section": "hyprlandLayoutGapsOutOverride",
|
"section": "hyprlandLayoutGapsOutOverride",
|
||||||
"label": "Outer Gaps",
|
"label": "Outer Gaps",
|
||||||
@@ -9316,6 +9342,26 @@
|
|||||||
],
|
],
|
||||||
"description": "Resize windows by dragging their edges with the mouse"
|
"description": "Resize windows by dragging their edges with the mouse"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"section": "showConfigReloadToast",
|
||||||
|
"label": "Show \\",
|
||||||
|
"tabIndex": 37,
|
||||||
|
"category": "Personalization",
|
||||||
|
"keywords": [
|
||||||
|
"appearance",
|
||||||
|
"compositor",
|
||||||
|
"config",
|
||||||
|
"custom",
|
||||||
|
"customize",
|
||||||
|
"personal",
|
||||||
|
"personalization",
|
||||||
|
"reload",
|
||||||
|
"reloaded",
|
||||||
|
"show",
|
||||||
|
"toast"
|
||||||
|
],
|
||||||
|
"description": "Show a toast when the compositor config is reloaded"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"section": "hyprlandLayoutRadiusOverride",
|
"section": "hyprlandLayoutRadiusOverride",
|
||||||
"label": "Window Corner Radius",
|
"label": "Window Corner Radius",
|
||||||
|
|||||||
Reference in New Issue
Block a user