billiob pushed a commit to branch master.

commit 2dc337428a45e0c8cf5dd44f3f3cf0af7c828af9
Author: Boris Faure <[email protected]>
Date:   Sun Sep 8 20:16:24 2013 +0200

    change theme on every tab/split. Closes T28
---
 src/bin/main.c          | 33 +++++++++++++++++++++++++++++++++
 src/bin/main.h          |  2 ++
 src/bin/options_theme.c |  2 ++
 3 files changed, 37 insertions(+)

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
 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)
 {
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);
 void main_media_mute_update(const Config *config);
 void main_config_sync(const Config *config);
 
+void change_theme(Evas_Object *win, Config *config);
+
 #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 @@
 #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

-- 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk

Reply via email to