mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
config: add initial-color-theme=1|2
This option selects which color theme to use by default. I.e. at startup, and after a reset. This is useful with combined theme files, where a single file defines e.g. both a dark and light version of the theme.
This commit is contained in:
parent
10e7f29149
commit
bc5b716668
7 changed files with 58 additions and 15 deletions
11
config.c
11
config.c
|
|
@ -1098,6 +1098,15 @@ parse_section_main(struct context *ctx)
|
|||
return true;
|
||||
}
|
||||
|
||||
else if (streq(key, "initial-color-theme")) {
|
||||
_Static_assert(
|
||||
sizeof(conf->initial_color_theme) == sizeof(int),
|
||||
"enum is not 32-bit");
|
||||
|
||||
return value_to_enum(ctx, (const char*[]){"1", "2", NULL},
|
||||
(int *)&conf->initial_color_theme);
|
||||
}
|
||||
|
||||
else {
|
||||
LOG_CONTEXTUAL_ERR("not a valid option: %s", key);
|
||||
return false;
|
||||
|
|
@ -3402,7 +3411,7 @@ config_load(struct config *conf, const char *conf_path,
|
|||
.url = false,
|
||||
},
|
||||
},
|
||||
|
||||
.initial_color_theme = COLOR_THEME1,
|
||||
.cursor = {
|
||||
.style = CURSOR_BLOCK,
|
||||
.unfocused_style = CURSOR_UNFOCUSED_HOLLOW,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue