refactor: unify file icon rendering

This commit is contained in:
CJ van den Berg 2025-08-13 14:43:30 +02:00
parent 38236bd93a
commit f3296482d0
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 4 additions and 4 deletions

View file

@ -94,10 +94,9 @@ pub fn Variant(comptime command: []const u8, comptime label_: []const u8, allow_
if (!(cbor.matchString(&iter, &description_) catch false)) @panic("invalid file_type description");
if (!(cbor.matchString(&iter, &icon) catch false)) @panic("invalid file_type icon");
if (!(cbor.matchInt(u24, &iter, &color) catch false)) @panic("invalid file_type color");
if (tui.config().show_fileicons) {
tui.render_file_icon(&button.plane, icon, color);
_ = button.plane.print(" ", .{}) catch {};
}
tui.render_file_icon(&button.plane, icon, color);
button.plane.set_style(style_label);
_ = button.plane.print("{s} ", .{description_}) catch {};

View file

@ -1437,6 +1437,7 @@ pub fn render_file_icon(self: *renderer.Plane, icon: []const u8, color: u24) voi
_ = self.cell_load(&cell, icon) catch {};
_ = self.putc(&cell) catch {};
self.cursor_move_rel(0, 1) catch {};
_ = self.print(" ", .{}) catch {};
}
pub fn render_match_cell(self: *renderer.Plane, y: usize, x: usize, theme_: *const Widget.Theme) !void {