refactor: unify file icon rendering
This commit is contained in:
parent
38236bd93a
commit
f3296482d0
2 changed files with 4 additions and 4 deletions
|
@ -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 {};
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue