summaryrefslogtreecommitdiff
path: root/core/Core.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Core.zig')
-rw-r--r--core/Core.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/Core.zig b/core/Core.zig
index 61d8c7e9..a16940e3 100644
--- a/core/Core.zig
+++ b/core/Core.zig
@@ -345,6 +345,8 @@ font_request_taken: bool = false,
custom_theme: ?Theme = null,
/// bodyChrome's: the theme it was worked out for, and it.
body_chrome: ?struct { theme: Theme, chrome: ChromeTheme } = null,
+/// The chrome of the theme a view wears (colors.wear): its index, and it.
+worn_chrome: ?struct { index: u16, chrome: ChromeTheme } = null,
theme_file_path: config.Settings.Text(limits.host_path_cap) = .{},
/// The ThemeFile last loaded whole: what /ctl and DumpConfig name, and
/// what a failed ThemeFile goes back to (colors.revertThemeFile).
@@ -531,7 +533,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", "worn_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
@@ -2137,12 +2139,15 @@ fn sizes(p: *const Pardes, pane: *const Pane) bool {
}
pub fn theme(p: *const Pardes) *const Theme {
+ // A theme the live view wears while it previews one (colors.wear).
+ if (p.views[p.live]) |*v| if (v.tag_state.worn) |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.views[p.live]) |*v| if (v.tag_state.worn) |i| if (p.worn_chrome) |*w| if (w.index == i) return &w.chrome;
return &p.chrome;
}