summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2013-09-08 20:16:24 +0200
committerBoris Faure <billiob@gmail.com>2013-09-08 20:16:24 +0200
commit2dc337428a45e0c8cf5dd44f3f3cf0af7c828af9 (patch)
tree2eeeea2729fc8b471703428e0d033fdbc8a10265
parent4a79fe43d55861161f425d7d27cc734904fa9afe (diff)
change theme on every tab/split. Closes T28
-rw-r--r--src/bin/main.c33
-rw-r--r--src/bin/main.h2
-rw-r--r--src/bin/options_theme.c2
3 files changed, 37 insertions, 0 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index 1dc85a7..bcb5d86 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -96,6 +96,39 @@ static Term *main_term_new(Win *wn, Config *config, const char *cmd, Eina_Bool l
96static void _term_focus(Term *term); 96static void _term_focus(Term *term);
97static void _sel_restore(Split *sp); 97static void _sel_restore(Split *sp);
98 98
99static Win *
100_win_find(Evas_Object *win)
101{
102 Win *wn;
103 Eina_List *l;
104
105 EINA_LIST_FOREACH(wins, l, wn)
106 {
107 if (wn->win == win) return wn;
108 }
109 return NULL;
110}
111
112void change_theme(Evas_Object *win, Config *config)
113{
114 Win *wn;
115 Eina_List *l;
116 Term *term;
117
118 wn = _win_find(win);
119 if (!wn) return;
120
121 EINA_LIST_FOREACH(wn->terms, l, term)
122 {
123 Evas_Object *edje = termio_theme_get(term->term);
124
125 if (!theme_apply(edje, config, "terminology/background"))
126 ERR("Couldn't find terminology theme!");
127 colors_term_init(termio_textgrid_get(term->term), edje);
128 termio_config_set(term->term, config);
129 }
130}
131
99static void 132static void
100_split_free(Split *sp) 133_split_free(Split *sp)
101{ 134{
diff --git a/src/bin/main.h b/src/bin/main.h
index fdb7eb7..c91dc07 100644
--- a/src/bin/main.h
+++ b/src/bin/main.h
@@ -13,4 +13,6 @@ void main_media_update(const Config *config);
13void main_media_mute_update(const Config *config); 13void main_media_mute_update(const Config *config);
14void main_config_sync(const Config *config); 14void main_config_sync(const Config *config);
15 15
16void change_theme(Evas_Object *win, Config *config);
17
16#endif 18#endif
diff --git a/src/bin/options_theme.c b/src/bin/options_theme.c
index dddda4c..49ab86b 100644
--- a/src/bin/options_theme.c
+++ b/src/bin/options_theme.c
@@ -6,6 +6,7 @@
6#include "options.h" 6#include "options.h"
7#include "options_theme.h" 7#include "options_theme.h"
8#include "utils.h" 8#include "utils.h"
9#include "main.h"
9 10
10static Evas_Object *op_themelist; 11static Evas_Object *op_themelist;
11 12
@@ -71,6 +72,7 @@ _cb_op_theme_sel(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUS
71 ERR("Couldn't find terminology theme!"); 72 ERR("Couldn't find terminology theme!");
72 colors_term_init(termio_textgrid_get(t->term), edje); 73 colors_term_init(termio_textgrid_get(t->term), edje);
73 termio_config_set(t->term, config); 74 termio_config_set(t->term, config);
75 change_theme(termio_win_get(t->term), config);
74} 76}
75 77
76static int 78static int