mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-16 08:21:20 -04:00
Reload colors2 as well as colors, naming tweaks.
This commit is contained in:
parent
9f5cf7abca
commit
938f30ee92
4 changed files with 10 additions and 5 deletions
1
config.c
1
config.c
|
|
@ -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
4
main.c
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
8
server.c
8
server.c
|
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
2
server.h
2
server.h
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue