summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-10-12 14:31:03 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-10-12 14:31:03 +0900
commitcc0f075b2742b767c63a29fb34d7137288953976 (patch)
treea46948fec9cc7f7b14e289378ff39f4741d2b0d2
parent8eba17574229d6a0229ef7f65ee622650f24ed6b (diff)
make theme auto-reload emit signals to configure stuff properly!
-rw-r--r--src/bin/main.c63
-rw-r--r--src/bin/utils.c7
2 files changed, 45 insertions, 25 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index b8260e9..41a1b2f 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -1998,32 +1998,8 @@ main_term_free(Term *term)
1998} 1998}
1999 1999
2000static void 2000static void
2001main_term_bg_redo(Term *term) 2001main_term_bg_config(Term *term)
2002{ 2002{
2003 Evas_Object *o;
2004
2005 if (term->tabcount_spacer)
2006 {
2007 evas_object_del(term->tabcount_spacer);
2008 term->tabcount_spacer = NULL;
2009 }
2010 evas_object_del(term->base);
2011 evas_object_del(term->bg);
2012
2013 term->base = o = edje_object_add(evas_object_evas_get(term->wn->win));
2014 theme_apply(o, term->config, "terminology/core");
2015
2016 theme_auto_reload_enable(o);
2017 evas_object_show(o);
2018
2019 term->bg = o = edje_object_add(evas_object_evas_get(term->wn->win));
2020 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2021 evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
2022 theme_apply(o, term->config, "terminology/background");
2023
2024 theme_auto_reload_enable(o);
2025 evas_object_show(o);
2026
2027 if (term->config->translucent) 2003 if (term->config->translucent)
2028 { 2004 {
2029 edje_object_signal_emit(term->bg, "translucent,on", "terminology"); 2005 edje_object_signal_emit(term->bg, "translucent,on", "terminology");
@@ -2089,6 +2065,39 @@ main_term_bg_redo(Term *term)
2089 } 2065 }
2090} 2066}
2091 2067
2068static void
2069main_term_bg_redo(Term *term)
2070{
2071 Evas_Object *o;
2072
2073 if (term->tabcount_spacer)
2074 {
2075 evas_object_del(term->tabcount_spacer);
2076 term->tabcount_spacer = NULL;
2077 }
2078 evas_object_del(term->base);
2079 evas_object_del(term->bg);
2080
2081 term->base = o = edje_object_add(evas_object_evas_get(term->wn->win));
2082 theme_apply(o, term->config, "terminology/core");
2083
2084 theme_auto_reload_enable(o);
2085 evas_object_data_set(o, "theme_reload_func", main_term_bg_config);
2086 evas_object_data_set(o, "theme_reload_func_data", term);
2087 evas_object_show(o);
2088
2089 term->bg = o = edje_object_add(evas_object_evas_get(term->wn->win));
2090 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2091 evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
2092 theme_apply(o, term->config, "terminology/background");
2093
2094 theme_auto_reload_enable(o);
2095 evas_object_data_set(o, "theme_reload_func", main_term_bg_config);
2096 evas_object_data_set(o, "theme_reload_func_data", term);
2097 evas_object_show(o);
2098 main_term_bg_config(term);
2099}
2100
2092static Term * 2101static Term *
2093main_term_new(Win *wn, Config *config, const char *cmd, 2102main_term_new(Win *wn, Config *config, const char *cmd,
2094 Eina_Bool login_shell, const char *cd, 2103 Eina_Bool login_shell, const char *cd,
@@ -2112,6 +2121,8 @@ main_term_new(Win *wn, Config *config, const char *cmd,
2112 theme_apply(o, term->config, "terminology/core"); 2121 theme_apply(o, term->config, "terminology/core");
2113 2122
2114 theme_auto_reload_enable(o); 2123 theme_auto_reload_enable(o);
2124 evas_object_data_set(o, "theme_reload_func", main_term_bg_config);
2125 evas_object_data_set(o, "theme_reload_func_data", term);
2115 evas_object_show(o); 2126 evas_object_show(o);
2116 2127
2117 term->bg = o = edje_object_add(evas_object_evas_get(wn->win)); 2128 term->bg = o = edje_object_add(evas_object_evas_get(wn->win));
@@ -2126,6 +2137,8 @@ main_term_new(Win *wn, Config *config, const char *cmd,
2126 } 2137 }
2127 2138
2128 theme_auto_reload_enable(o); 2139 theme_auto_reload_enable(o);
2140 evas_object_data_set(o, "theme_reload_func", main_term_bg_config);
2141 evas_object_data_set(o, "theme_reload_func_data", term);
2129 evas_object_show(o); 2142 evas_object_show(o);
2130 2143
2131 if (term->config->translucent) 2144 if (term->config->translucent)
diff --git a/src/bin/utils.c b/src/bin/utils.c
index 027254e..67fb71c 100644
--- a/src/bin/utils.c
+++ b/src/bin/utils.c
@@ -43,7 +43,14 @@ theme_reload(Evas_Object *edje)
43static void 43static void
44theme_reload_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) 44theme_reload_cb(void *data EINA_UNUSED, Evas_Object *obj, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
45{ 45{
46 void (*func) (void *d);
47 void *func_data;
48
46 theme_reload(obj); 49 theme_reload(obj);
50 func = evas_object_data_get(obj, "theme_reload_func");
51 func_data = evas_object_data_get(obj, "theme_reload_func_data");
52 printf("%p %p\n", func, func_data);
53 if (func) func(func_data);
47} 54}
48 55
49void 56void