From b9fbd6825d684c640809fdd5c41b008117da5e91 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 3 Jun 2025 19:16:22 +0200 Subject: [PATCH] fix: minor home screen fixes --- src/renderer/vaxis/Plane.zig | 4 ++++ src/tui/Fire.zig | 6 +++++- src/tui/home.zig | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/renderer/vaxis/Plane.zig b/src/renderer/vaxis/Plane.zig index 81384d6..80df067 100644 --- a/src/renderer/vaxis/Plane.zig +++ b/src/renderer/vaxis/Plane.zig @@ -217,6 +217,10 @@ pub fn putstr_unicode(self: *Plane, text: []const u8) !usize { return result; } +pub fn putchar(self: *Plane, ecg: []const u8) void { + self.write_cell(@intCast(self.col), @intCast(self.row), ecg); +} + pub fn putc(self: *Plane, cell: *const Cell) !usize { return self.putc_yx(@intCast(self.row), @intCast(self.col), cell); } diff --git a/src/tui/Fire.zig b/src/tui/Fire.zig index 4216dd6..2965cce 100644 --- a/src/tui/Fire.zig +++ b/src/tui/Fire.zig @@ -67,6 +67,10 @@ const fire_white: u8 = fire_palette.len - 1; pub fn render(self: *Fire) void { self.plane.home(); + const transparent = self.plane.transparent; + self.plane.transparent = false; + defer self.plane.transparent = transparent; + var rand = self.prng.random(); //update fire buf @@ -118,7 +122,7 @@ pub fn render(self: *Fire) void { self.plane.set_fg_palindex(fire_palette[px_hi]) catch {}; self.plane.set_bg_palindex(fire_palette[px_lo]) catch {}; - _ = self.plane.putstr(px) catch {}; + _ = self.plane.putchar(px); } self.plane.cursor_move_yx(-1, 0) catch {}; self.plane.cursor_move_rel(1, 0) catch {}; diff --git a/src/tui/home.zig b/src/tui/home.zig index a1684e5..42406d0 100644 --- a/src/tui/home.zig +++ b/src/tui/home.zig @@ -266,6 +266,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool { self.plane.erase(); self.plane.home(); if (self.fire) |*fire| fire.render(); + self.plane.set_base_style(theme.editor); const style_title = if (tui.find_scope_style(theme, "function")) |sty| sty.style else theme.editor; const style_subtext = if (tui.find_scope_style(theme, "comment")) |sty| sty.style else theme.editor;