diff options
Diffstat (limited to 'core/Core.zig')
| -rw-r--r-- | core/Core.zig | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/Core.zig b/core/Core.zig index 6ee82370..d0011048 100644 --- a/core/Core.zig +++ b/core/Core.zig @@ -337,6 +337,11 @@ locations_cache: locations.Cache = .{}, tty_filter_palette: pardes.Term.FilterPalette = .{}, font_request_taken: bool = false, custom_theme: ?Theme = null, +/// The theme the window wears while a picker of them (or `:theme `) +/// previews one, by index, and its chrome (colors.previewTheme); the +/// session's own theme untouched under it. +theme_preview: ?u16 = null, +preview_chrome: ChromeTheme = colors.initial_chrome, /// bodyChrome's: the theme it was worked out for, and it. body_chrome: ?struct { theme: Theme, chrome: ChromeTheme } = null, theme_file_path: config.Settings.Text(limits.host_path_cap) = .{}, @@ -525,7 +530,7 @@ pub const replica = .{ "opts", "dump_out", "dump_export", "tape", }, - .derived = .{ "shell_rows", "diff_output", "locations_cache", "retired_panes", "tty_filter_palette", "body_chrome" }, + .derived = .{ "shell_rows", "diff_output", "locations_cache", "retired_panes", "tty_filter_palette", "body_chrome", "theme_preview", "preview_chrome" }, // The host's handles, the state file every session of the user // shares (and Recent read from it), this session's closed panes, and // the files of a host with no file system of its own. (The 9P @@ -2130,12 +2135,14 @@ fn sizes(p: *const Pardes, pane: *const Pane) bool { } pub fn theme(p: *const Pardes) *const Theme { + if (p.theme_preview) |i| return &themes[i]; if (p.custom_theme) |*custom| return custom; return &themes[p.settings.theme]; } /// The colours of the chrome: the theme's, set as it changes. pub fn chromeTheme(p: *const Pardes) *const ChromeTheme { + if (p.theme_preview != null) return &p.preview_chrome; return &p.chrome; } |
