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 {};