From d2d03992eb407adefb21ad47ef5f501a267cfc04 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sat, 11 Nov 2017 23:16:15 +0100 Subject: [PATCH] theme previews: set shine according to config --- src/bin/options_themepv.c | 3 +++ src/bin/win.c | 19 +++++++++---------- src/bin/win.h | 1 + 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/bin/options_themepv.c b/src/bin/options_themepv.c index 69d66a42..e84e2cbd 100644 --- a/src/bin/options_themepv.c +++ b/src/bin/options_themepv.c @@ -114,6 +114,9 @@ options_theme_preview_add(Evas_Object *parent, Config *config, const char *file, edje_object_signal_emit(oe, "translucent,on", "terminology"); else edje_object_signal_emit(oe, "translucent,off", "terminology"); + + background_set_shine(config, oe); + edje_object_signal_emit(oe, "focus,in", "terminology"); edje_object_signal_emit(oe, "tabcount,on", "terminology"); edje_object_signal_emit(oe, "tabmissed,on", "terminology"); diff --git a/src/bin/win.c b/src/bin/win.c index 6c0cb50d..56c8e580 100644 --- a/src/bin/win.c +++ b/src/bin/win.c @@ -182,7 +182,6 @@ static Tab_Item* tab_item_new(Tabs *tabs, Term_Container *child); static void _tabs_refresh(Tabs *tabs); static void _term_tabregion_free(Term *term); static void _set_trans(Config *config, Evas_Object *bg, Evas_Object *base); -static void _set_shine(Config *config, Evas_Object *bg); /* {{{ Solo */ @@ -2123,8 +2122,8 @@ _cb_tab_selector_show(Tabs *tabs, Tab_Item *to_item) evas_object_geometry_set(tabs->selector_bg, x, y, w, h); evas_object_hide(o); - _set_trans(wn->config, tabs->selector_bg, NULL); - _set_shine(wn->config, tabs->selector_bg); + _set_trans(wn->config, tabs->selector_bg, NULL); + background_set_shine(wn->config, tabs->selector_bg); edje_object_signal_emit(tabs->selector_bg, "begin", "terminology"); tab_item = tabs->current; @@ -3005,8 +3004,8 @@ _tabs_new(Term_Container *child, Term_Container *parent) /* }}} */ /* {{{ Term */ -static void -_set_shine(Config *config, Evas_Object *bg) +void +background_set_shine(Config *config, Evas_Object *bg) { Edje_Message_Int msg; @@ -3027,7 +3026,7 @@ term_apply_shine(Term *term, int shine) if (config->shine != shine) { config->shine = shine; - _set_shine(config, term->bg); + background_set_shine(config, term->bg); config_save(config, NULL); } } @@ -4289,8 +4288,8 @@ _cb_tabcount_next(void *data, static void _term_bg_config(Term *term) { - _set_trans(term->config, term->bg, term->base); - _set_shine(term->config, term->bg); + _set_trans(term->config, term->bg, term->base); + background_set_shine(term->config, term->bg); termio_theme_set(term->termio, term->bg); edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology", @@ -4579,8 +4578,8 @@ term_new(Win *wn, Config *config, const char *cmd, if (term->config->mv_always_show) term->miniview_shown = EINA_TRUE; - _set_trans(term->config, term->bg, term->base); - _set_shine(term->config, term->bg); + _set_trans(term->config, term->bg, term->base); + background_set_shine(term->config, term->bg); term->termio = o = termio_add(wn->win, config, cmd, login_shell, cd, size_w, size_h, term, title); diff --git a/src/bin/win.h b/src/bin/win.h index c646f90d..e496acf3 100644 --- a/src/bin/win.h +++ b/src/bin/win.h @@ -76,5 +76,6 @@ for_each_term_do(Win *wn, For_Each_Term cb, void *data); void term_apply_shine(Term *term, int shine); +void background_set_shine(Config *config, Evas_Object *bg); #endif