From eb54d96e872332fa4f7c8d014024a4c8ab3e7e1a Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Sat, 14 Feb 2026 13:27:03 +0100 Subject: [PATCH] fix: fallback to theme foreground color for icons in file tree --- src/tui/mode/overlay/project_file_tree_palette.zig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tui/mode/overlay/project_file_tree_palette.zig b/src/tui/mode/overlay/project_file_tree_palette.zig index 0f19352..c27b838 100644 --- a/src/tui/mode/overlay/project_file_tree_palette.zig +++ b/src/tui/mode/overlay/project_file_tree_palette.zig @@ -170,8 +170,8 @@ fn getNodeIconAndColor(node: *const Node) !struct { []const u8, u24 } { // Add folder icon or file icon if (node.type_ == .folder) { if (node.expanded) { - return .{ "", 0xAAAAAA }; - } else return .{ "", 0xAAAAAA }; + return .{ "", 0 }; + } else return .{ "", 0 }; } _, const icon_, const color_ = guess_file_type(node.path); @@ -182,7 +182,7 @@ fn default_ft() struct { []const u8, []const u8, u24 } { return .{ file_type_config.default.name, file_type_config.default.icon, - 0xAAAAAA, // At least with my theme the default color (black) was barely visible + 0, }; } @@ -231,6 +231,9 @@ pub fn on_render_menu(_: *Type, button: *Type.ButtonType, theme: *const Widget.T if (!(cbor.matchString(&iter, &file_icon) catch false)) return false; if (!(cbor.matchInt(u24, &iter, &icon_color) catch false)) return false; + if (icon_color == 0xFFFFFF or icon_color == 0x000000 or icon_color == 0x000001) + icon_color = style_label.fg.?.color; + var icon_style = style_label; icon_style.fg.?.color = icon_color;