config: share translucent+opacity settings accross instances

terminology-1.7
Boris Faure 3 years ago
parent 6b8da82722
commit cbbfe60aae
Signed by: borisfaure
GPG Key ID: 35C0410516166BE8
  1. 2
      src/bin/config.c
  2. 4
      src/bin/main.c
  3. 4
      src/bin/options_background.c
  4. 34
      src/bin/win.c
  5. 2
      src/bin/win.h

@ -318,6 +318,8 @@ config_sync(const Config *config_src, Config *config)
config->changedir_to_current = config_src->changedir_to_current;
config->emoji_dbl_width = config_src->emoji_dbl_width;
config->shine = config_src->shine;
config->translucent = config_src->translucent;
config->opacity = config_src->opacity;
}
static void

@ -413,7 +413,7 @@ main_ipc_new(Ipc_Instance *inst)
if (win_term_set(wn, term) < 0)
return;
main_trans_update(config);
main_trans_update();
main_media_update(config);
if (inst->pos)
{
@ -607,7 +607,7 @@ _start(Ipc_Instance *instance, Eina_Bool need_scale_wizard)
goto exit;
}
main_trans_update(config);
main_trans_update();
main_media_update(config);
win_sizing_handle(wn);
win = win_evas_object_get(wn);

@ -76,8 +76,8 @@ _cb_op_video_trans_chg(void *data,
config->translucent = elm_check_state_get(obj);
elm_object_disabled_set(ctx->op_opacity, !config->translucent);
main_trans_update(config);
config_save(config);
main_trans_update();
}
static void
@ -91,8 +91,8 @@ _cb_op_video_opacity_chg(void *data,
config->opacity = elm_slider_value_get(obj);
if (!config->translucent)
return;
main_trans_update(config);
config_save(config);
main_trans_update();
}
static void

@ -1013,7 +1013,7 @@ win_evas_object_get(const Win *wn)
}
static void
_win_trans(Win *wn, Term *term, Eina_Bool trans)
_win_trans(Win *wn, Term *term)
{
Edje_Message_Int msg;
Evas_Object *edje = elm_layout_edje_get(term->core);
@ -1025,7 +1025,7 @@ _win_trans(Win *wn, Term *term, Eina_Bool trans)
edje_object_message_send(term->bg, EDJE_MESSAGE_INT, 1, &msg);
edje_object_message_send(edje, EDJE_MESSAGE_INT, 1, &msg);
if (trans)
if (term->config->translucent)
{
elm_win_alpha_set(wn->win, EINA_TRUE);
evas_object_hide(wn->backbg);
@ -1038,36 +1038,17 @@ _win_trans(Win *wn, Term *term, Eina_Bool trans)
}
void
main_trans_update(const Config *config)
main_trans_update(void)
{
Win *wn;
Term *term, *term2;
Term *term;
Eina_List *l, *ll;
EINA_LIST_FOREACH(wins, l, wn)
{
EINA_LIST_FOREACH(wn->terms, ll, term)
{
if (term->config == config)
{
if (config->translucent)
_win_trans(wn, term, EINA_TRUE);
else
{
Eina_Bool trans_exists = EINA_FALSE;
EINA_LIST_FOREACH(wn->terms, ll, term2)
{
if (term2->config->translucent)
{
trans_exists = EINA_TRUE;
break;
}
}
_win_trans(wn, term, trans_exists);
}
return;
}
_win_trans(wn, term);
}
}
}
@ -5831,7 +5812,7 @@ void change_theme(Evas_Object *win, Config *config)
if (l) l = eina_list_last(l);
if (l) elm_theme_overlay_del(NULL, l->data);
elm_theme_overlay_add(NULL, config_theme_path_get(config));
main_trans_update(config);
main_trans_update();
}
void
@ -6166,10 +6147,9 @@ _set_alpha(Config *config, const char *val, Eina_Bool save)
config->translucent = EINA_TRUE;
else
config->translucent = EINA_FALSE;
main_trans_update(config);
if (save)
config_save(config);
main_trans_update();
}
static void

@ -90,6 +90,6 @@ void
term_apply_shine(Term *term, int shine);
void background_set_shine(Config *config, Evas_Object *bg);
void main_trans_update(const Config *config);
void main_trans_update();
#endif

Loading…
Cancel
Save