Skip to content

Commit

Permalink
config: change toast config to packed struct
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Jan 2, 2025
1 parent e6bb1a5 commit fb8c83e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/apprt/gtk/Window.zig
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ fn gtkActionCopy(
return;
};

if (self.app.config.@"toast-on-clipboard-copy") {
if (self.app.config.@"adw-toast".@"clipboard-copy") {
self.sendToast("Copied to clipboard");
}
}
Expand Down
24 changes: 21 additions & 3 deletions src/config/Config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1276,9 +1276,6 @@ keybind: Keybinds = .{},
@"clipboard-read": ClipboardAccess = .ask,
@"clipboard-write": ClipboardAccess = .allow,

/// Enables or disables the toast message on a clipboard copy action.
@"toast-on-clipboard-copy": bool = true,

/// Trims trailing whitespace on data that is copied to the clipboard. This does
/// not affect data sent to the clipboard via `clipboard-write`.
@"clipboard-trim-trailing-spaces": bool = true,
Expand Down Expand Up @@ -1945,6 +1942,22 @@ keybind: Keybinds = .{},
/// Changing this value at runtime will only affect new windows.
@"adw-toolbar-style": AdwToolbarStyle = .raised,

/// Control the toasts that Ghostty shows. Toasts are small notifications
/// that appear overlaid on top of the terminal window. They are used to
/// show information that is not critical but may be important.
///
/// Valid values are:
///
/// - `clipboard-copy` (default: true) - Show a toast when text is copied
/// to the clipboard.
///
/// You can prefix any value with `no-` to disable it. For example,
/// `no-clipboard-copy` will disable the clipboard copy toast. Multiple
/// values can be set by separating them with commas.
///
/// This configuration only applies to GTK with Adwaita enabled.
@"adw-toast": AdwToast = .{},

/// If `true` (default), then the Ghostty GTK tabs will be "wide." Wide tabs
/// are the new typical Gnome style where tabs fill their available space.
/// If you set this to `false` then tabs will only take up space they need,
Expand Down Expand Up @@ -5445,6 +5458,11 @@ pub const AdwToolbarStyle = enum {
@"raised-border",
};

/// See adw-toast
pub const AdwToast = packed struct {
@"clipboard-copy": bool = true,
};

/// See mouse-shift-capture
pub const MouseShiftCapture = enum {
false,
Expand Down

0 comments on commit fb8c83e

Please sign in to comment.