diff options
Diffstat (limited to 'core')
| -rw-r--r-- | core/colors.zig | 2 | ||||
| -rw-r--r-- | core/draw.zig | 21 | ||||
| -rw-r--r-- | core/surface.zig | 9 |
3 files changed, 20 insertions, 12 deletions
diff --git a/core/colors.zig b/core/colors.zig index 4e4bd9ba..d280172e 100644 --- a/core/colors.zig +++ b/core/colors.zig @@ -85,7 +85,7 @@ pub const separator_floor: f32 = 1.5; /// the GUI's default ground, and a dark terminal's. pub const null_page: [3]u8 = .{ 18, 18, 18 }; /// The ink of a theme with none, on a dark page and on a light one. -const null_text: [3]u8 = .{ 0xcc, 0xcc, 0xcc }; +pub const null_text: [3]u8 = .{ 0xcc, 0xcc, 0xcc }; const null_text_light: [3]u8 = .{ 0x22, 0x22, 0x22 }; fn separatorOf(th: *const LegacyTheme) [3]u8 { const base = th.border orelse th.scroll_track; diff --git a/core/draw.zig b/core/draw.zig index 2553d5be..d2e54cbb 100644 --- a/core/draw.zig +++ b/core/draw.zig @@ -330,11 +330,14 @@ pub fn render(p: *Pardes, arena: std.mem.Allocator) !*Surface { s.placements.clearRetainingCapacity(); @memset(&s.gpu_frames, null); const chrome = p.chromeTheme(); + // The window's rules and grips from the chrome (the themes programme's + // L2e; DESIGN.md R6, R11, G1'). + const resolved = p.chrome(); s.chrome = .{ .page = p.theme().bg, .fg = p.theme().fg, - .border = chrome.border, - .topbar_rule = config.gui_topbar_pane_border_rgb orelse chrome.border, + .border = resolved.rule, + .topbar_rule = config.gui_topbar_pane_border_rgb orelse resolved.rule, .tag_bg = chrome.tag_bg, .tagline_bg = chrome.tagline_bg, .tag_focus_bg = chrome.tag_active_bg, @@ -344,12 +347,14 @@ pub fn render(p: *Pardes, arena: std.mem.Allocator) !*Surface { .scroll_thumb = chrome.scroll_thumb, .match_tick = chrome.search_bg, .match_current = p.theme().fg orelse chrome.tag_fg, - .rule_px = p.theme().rule_px orelse 2, - .grip_border = boxBorder(p), - .grip_focus_ring = chrome.box, - .grip_dirty = boxDirty(p), - .tag_rule = p.theme().tag_rule, - .rail_px = @intCast(@min(255, @as(u32, p.theme().rail_px orelse 12) * p.settings.grip_width / 100)), + .rule_px = resolved.rule_px, + .grip_border = resolved.grip.ring, + .grip_focus_ring = resolved.grip.focus, + .grip_dirty = resolved.grip.dirty, + .grip_mode = resolved.grip.mode, + .grip_ink = resolved.grip.ink, + .tag_rule = resolved.tag_rule, + .rail_px = @intCast(@min(255, @as(u32, resolved.rail_px) * p.settings.grip_width / 100)), }; place(p, s); // Separators have their own role; a scrollbar need not frame the page. diff --git a/core/surface.zig b/core/surface.zig index b78b58de..ce8898ad 100644 --- a/core/surface.zig +++ b/core/surface.zig @@ -206,9 +206,12 @@ pub const Chrome = struct { grip_focus_ring: [3]u8 = .{ 0, 0, 0 }, /// A dirty pane's button fill. grip_dirty: [3]u8 = .{ 0, 0, 0 }, - /// The rule between a pane's tag and its body; null is halfway between - /// the tag's ground and the page the shell actually draws. - tag_rule: ?[3]u8 = null, + /// A reading pane's ring (DESIGN.md G1'), and the ink on a filled + /// button. + grip_mode: [3]u8 = .{ 0, 0, 0 }, + grip_ink: [3]u8 = .{ 0, 0, 0 }, + /// The rule between a pane's tag and its body. + tag_rule: [3]u8 = .{ 0, 0, 0 }, /// The scroll column's width, button and scrollbar alike, in pixels at /// a 17px tagline (acme's 12 at its font); a pixel shell scales it. rail_px: u8 = 12, |
