change theme on every tab/split. Closes T28
This commit is contained in:
parent
4a79fe43d5
commit
2dc337428a
|
@ -96,6 +96,39 @@ static Term *main_term_new(Win *wn, Config *config, const char *cmd, Eina_Bool l
|
|||
static void _term_focus(Term *term);
|
||||
static void _sel_restore(Split *sp);
|
||||
|
||||
static Win *
|
||||
_win_find(Evas_Object *win)
|
||||
{
|
||||
Win *wn;
|
||||
Eina_List *l;
|
||||
|
||||
EINA_LIST_FOREACH(wins, l, wn)
|
||||
{
|
||||
if (wn->win == win) return wn;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void change_theme(Evas_Object *win, Config *config)
|
||||
{
|
||||
Win *wn;
|
||||
Eina_List *l;
|
||||
Term *term;
|
||||
|
||||
wn = _win_find(win);
|
||||
if (!wn) return;
|
||||
|
||||
EINA_LIST_FOREACH(wn->terms, l, term)
|
||||
{
|
||||
Evas_Object *edje = termio_theme_get(term->term);
|
||||
|
||||
if (!theme_apply(edje, config, "terminology/background"))
|
||||
ERR("Couldn't find terminology theme!");
|
||||
colors_term_init(termio_textgrid_get(term->term), edje);
|
||||
termio_config_set(term->term, config);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_split_free(Split *sp)
|
||||
{
|
||||
|
|
|
@ -13,4 +13,6 @@ void main_media_update(const Config *config);
|
|||
void main_media_mute_update(const Config *config);
|
||||
void main_config_sync(const Config *config);
|
||||
|
||||
void change_theme(Evas_Object *win, Config *config);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "options.h"
|
||||
#include "options_theme.h"
|
||||
#include "utils.h"
|
||||
#include "main.h"
|
||||
|
||||
static Evas_Object *op_themelist;
|
||||
|
||||
|
@ -71,6 +72,7 @@ _cb_op_theme_sel(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUS
|
|||
ERR("Couldn't find terminology theme!");
|
||||
colors_term_init(termio_textgrid_get(t->term), edje);
|
||||
termio_config_set(t->term, config);
|
||||
change_theme(termio_win_get(t->term), config);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue