feat: add option to disable the "Reloaded the configuration" notification (#8366)

Redo of #8085 since I can't push that branch.
This commit is contained in:
Mitchell Hashimoto
2025-08-23 12:59:09 -07:00
committed by GitHub
3 changed files with 14 additions and 2 deletions

View File

@@ -961,7 +961,14 @@ pub const Window = extern struct {
_: *gobject.ParamSpec,
self: *Self,
) callconv(.c) void {
self.addToast(i18n._("Reloaded the configuration"));
const priv = self.private();
if (priv.config) |config_obj| {
const config = config_obj.get();
if (config.@"app-notifications".@"config-reload") {
self.addToast(i18n._("Reloaded the configuration"));
}
}
self.syncAppearance();
}

View File

@@ -772,7 +772,9 @@ pub fn focusCurrentTab(self: *Window) void {
}
pub fn onConfigReloaded(self: *Window) void {
self.sendToast(i18n._("Reloaded the configuration"));
if (self.app.config.@"app-notifications".@"config-reload") {
self.sendToast(i18n._("Reloaded the configuration"));
}
}
pub fn sendToast(self: *Window, title: [*:0]const u8) void {

View File

@@ -2499,6 +2499,8 @@ keybind: Keybinds = .{},
///
/// - `clipboard-copy` (default: true) - Show a notification when text is copied
/// to the clipboard.
/// - `config-reload` (default: true) - Show a notification when
/// the configuration is reloaded.
///
/// To specify a notification to enable, specify the name of the notification.
/// To specify a notification to disable, prefix the name with `no-`. For
@@ -7058,6 +7060,7 @@ pub const GtkTitlebarStyle = enum(c_int) {
/// See app-notifications
pub const AppNotifications = packed struct {
@"clipboard-copy": bool = true,
@"config-reload": bool = true,
};
/// See bell-features