Reload colors2 as well as colors, naming tweaks.

This commit is contained in:
wreald 2025-05-31 15:42:29 +10:00
parent 9f5cf7abca
commit 938f30ee92
4 changed files with 10 additions and 5 deletions

View file

@ -3872,6 +3872,7 @@ config_reload_colors(struct config *conf)
// loading the config? // loading the config?
conf->colors = new_conf.colors; conf->colors = new_conf.colors;
conf->colors2 = new_conf.colors2;
config_free(&new_conf); config_free(&new_conf);
} }

4
main.c
View file

@ -48,14 +48,14 @@ fdm_sigint(struct fdm *fdm, int signo, void *data)
static bool static bool
fdm_sigusr1_server(struct fdm *fdm, int signo, void *data) fdm_sigusr1_server(struct fdm *fdm, int signo, void *data)
{ {
server_hard_reload_config_colors(data); server_reload_config_colors(data);
return true; return true;
} }
static bool static bool
fdm_sigusr1_term(struct fdm *fdm, int signo, void *data) fdm_sigusr1_term(struct fdm *fdm, int signo, void *data)
{ {
term_hard_reload_config_colors(data); term_reload_config_colors(data);
return true; return true;
} }

View file

@ -593,7 +593,7 @@ err:
/* Reload configured colors from disk. */ /* Reload configured colors from disk. */
void void
server_hard_reload_config_colors(struct server *server) { server_reload_config_colors(struct server *server) {
config_reload_colors((struct config *)server->conf); config_reload_colors((struct config *)server->conf);
tll_foreach(server->wayl->terms, it) { tll_foreach(server->wayl->terms, it) {
@ -601,7 +601,11 @@ server_hard_reload_config_colors(struct server *server) {
((struct config *)term->conf)->colors = server->conf->colors; ((struct config *)term->conf)->colors = server->conf->colors;
term_soft_reload_config_colors(term); if (term->colors.active_theme == COLOR_THEME1) {
term_theme_apply(term, &term->conf->colors);
} else {
term_theme_apply(term, &term->conf->colors2);
}
} }
} }

View file

@ -9,4 +9,4 @@ struct server;
struct server *server_init(const struct config *conf, struct fdm *fdm, struct server *server_init(const struct config *conf, struct fdm *fdm,
struct reaper *reaper, struct wayland *wayl); struct reaper *reaper, struct wayland *wayl);
void server_destroy(struct server *server); void server_destroy(struct server *server);
void server_hard_reload_config_colors(struct server *server); void server_reload_config_colors(struct server *server);