add support for setting window opacity

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2014-12-02 12:28:24 -05:00
parent 3101a2f410
commit 82ac30d8cb
2 changed files with 21 additions and 12 deletions

View File

@ -31,19 +31,17 @@ struct _Channel
static void
_cb_theme_reload(Channel *chl)
{
if (chl->translucent == _ex_cfg->gui.translucent) return;
Edje_Message_Int msg;
chl->translucent = _ex_cfg->gui.translucent;
if (chl->translucent)
{
edje_object_signal_emit(chl->o_bg, "translucent,on", PACKAGE_NAME);
edje_object_signal_emit(chl->o_base, "translucent,on", PACKAGE_NAME);
}
msg.val = _ex_cfg->gui.opacity;
else
{
edje_object_signal_emit(chl->o_bg, "translucent,off", PACKAGE_NAME);
edje_object_signal_emit(chl->o_base, "translucent,off", PACKAGE_NAME);
}
msg.val = 100;
edje_object_message_send(chl->o_bg, EDJE_MESSAGE_INT, 1, &msg);
edje_object_message_send(chl->o_base, EDJE_MESSAGE_INT, 1, &msg);
}
static void
@ -174,9 +172,9 @@ _channel_create(Evas *evas, const char *name)
chl->o_grid = _grid_add(evas);
WEIGHT_SET(chl->o_grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
FILL_SET(chl->o_grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_event_callback_add(chl->o_grid,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_cb_size_hint, chl);
/* evas_object_event_callback_add(chl->o_grid, */
/* EVAS_CALLBACK_CHANGED_SIZE_HINTS, */
/* _cb_size_hint, chl); */
evas_object_smart_callback_add(chl->o_grid, "options", _cb_options, chl);
evas_object_smart_callback_add(chl->o_grid, "prev", _cb_prev, chl);
evas_object_smart_callback_add(chl->o_grid, "next", _cb_next, chl);

View File

@ -440,6 +440,17 @@ _window_update(void)
{
Eina_List *l = NULL;
Channel *chl;
Edje_Message_Int msg;
if (!_win) return;
/* adjust opacity of window */
if (_ex_cfg->gui.translucent)
msg.val = _ex_cfg->gui.opacity;
else
msg.val = 100;
edje_object_message_send(_win->o_bg, EDJE_MESSAGE_INT, 1, &msg);
edje_object_message_send(_win->o_base, EDJE_MESSAGE_INT, 1, &msg);
/* set window alpha based on config */
elm_win_alpha_set(_win->o_win, _ex_cfg->gui.translucent);