diff options
Diffstat (limited to 'core/theme_schema.zig')
| -rw-r--r-- | core/theme_schema.zig | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/core/theme_schema.zig b/core/theme_schema.zig index 788cf3bf..f2f05d68 100644 --- a/core/theme_schema.zig +++ b/core/theme_schema.zig @@ -98,46 +98,6 @@ pub const Theme = struct { out.deleted = null; return out; } - - /// The old names' view of a theme, for what still reads them: the - /// fields the new names leave to the derivation (`derived`) filled in - /// from it; `added`, `deleted` and `mode`, which the old names have no - /// field for, left out. - pub fn toLegacy(th: *const Theme, derived: Derived) LegacyTheme { - var out: LegacyTheme = undefined; - inline for (renames) |r| { - const from = @field(th, r[1]); - const same = comptime @FieldType(LegacyTheme, r[0]) == @TypeOf(from); - @field(out, r[0]) = if (same) from else from orelse @field(derived, r[0]); - } - inline for (dropped) |name| @field(out, name) = @field(derived, name); - if (th.sweeps) |sweeps| { - out.sweep_bg = undefined; - out.sweep_fg = undefined; - for (sweeps, &out.sweep_bg.?, &out.sweep_fg.?) |s, *ground, *ink| { - ground.* = s.ground; - ink.* = s.text; - } - } else { - out.sweep_bg = null; - out.sweep_fg = null; - } - return out; - } - - /// What `toLegacy` takes from the derivation: the old names' required - /// fields the new ones make optional, and the ones they leave out. - pub const Derived = struct { - sel_fg: [3]u8, - lineno: [3]u8, - scroll_track: [3]u8, - scroll_thumb: [3]u8, - box_dim: [3]u8, - column_box_dim: ?[3]u8 = null, - tag_active_name_fg: ?[3]u8 = null, - search_fg: ?[3]u8 = null, - tag_reading_bg: ?[3]u8 = null, - }; }; /// Old name, new name: the mechanical layer (DESIGN.md G6). Without the @@ -229,7 +189,7 @@ pub const LegacyTheme = struct { palette: ?[16][3]u8, // Pardes UI roles. Optional so existing ThemeFile documents and imported - // editor palettes keep working; ChromeTheme resolves their legacy defaults. + // editor palettes keep working; Theme.fromLegacy and Chrome.of derive them. tag_active_bg: ?[3]u8 = null, tag_active_fg: ?[3]u8 = null, /// The workspace row (the tagline): an editor's status bar in its own @@ -257,8 +217,8 @@ pub const LegacyTheme = struct { lineno_active: ?[3]u8 = null, /// A tag's selection, where it differs from the body's (acme's #9eeeee). tag_sel_bg: ?[3]u8 = null, - /// The tag of a reading pane, one a jump steps (Trail.zig): unset, or - /// too near the tag to see, the tag toward paper yellow (readingOf). + /// The tag of a reading pane, one a jump steps (Trail.zig): read and + /// dropped (DESIGN.md G1': a reading pane is marked on its grip). tag_reading_bg: ?[3]u8 = null, /// Each pointer button's sweep, select, exec and look (Mouse.Button /// order), and the ink over it. Unset, tints of `sel_bg` in `sel_fg`. |
