feat: support adding entirely new themes via the config

This commit is contained in:
CJ van den Berg 2026-03-31 20:58:00 +02:00
parent d53d155c6d
commit 310221bb26
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
5 changed files with 126 additions and 71 deletions

View file

@ -33,7 +33,8 @@ pub fn load_entries(palette: *Type) !usize {
var longest_hint: usize = 0;
var idx: usize = 0;
try set_previous_theme(palette, tui.theme().name);
for (Widget.themes) |theme| {
for (Widget.list_themes()) |theme_name_| {
const theme = Widget.get_theme_by_name(palette.allocator, theme_name_) orelse continue;
idx += 1;
(try palette.entries.addOne(palette.allocator)).* = .{
.label = theme.description,