Fix translucency again.

This commit is contained in:
Alastair Poole 2018-07-31 10:52:08 +01:00
parent 1c00bdb17f
commit bd049d3dd8
3 changed files with 29 additions and 3 deletions

View File

@ -1521,6 +1521,7 @@ edi_open(const char *inputpath)
elm_win_resize_object_add(win, hbx);
evas_object_show(hbx);
edi_theme_main_box_set(hbx);
edi_theme_window_alpha_set();
tb = edi_toolbar_setup(hbx);

View File

@ -11,29 +11,51 @@
#include "edi_private.h"
static Eina_List *_edi_themes = NULL;
static Evas_Object *_main_box = NULL;
// we are hooking into Efl for now...
Efl_Ui_Theme_Apply efl_ui_widget_theme_apply(Eo *obj);
void
edi_theme_main_box_set(Evas_Object *box)
{
_main_box = box;
}
Evas_Object *
edi_theme_main_box_get(void)
{
return _main_box;
}
void
edi_theme_window_alpha_set(void)
{
Evas_Object *win;
Evas_Object *background;
static int r, g, b, a;
Eina_Bool enabled = _edi_project_config->gui.translucent;
win = edi_main_win_get();
elm_win_alpha_set(win, enabled);
background = edi_theme_main_box_get();
if (!background)
return;
if (!r && !g && !b && !a)
evas_object_color_get(background, &r, &g, &b, &a);
if (enabled)
efl_gfx_color_set(efl_part(win, "background"), 64, 64, 64, _edi_project_config->gui.alpha);
evas_object_color_set(background, r, g, b, _edi_project_config->gui.alpha);
else
efl_gfx_color_set(efl_part(win, "background"), 64, 64, 64, 255);
evas_object_color_set(background, r, g, b, 255);
}
void edi_theme_elm_code_alpha_set(Evas_Object *obj)
{
if (_edi_project_config->gui.translucent)
if (_edi_project_config->gui.translucent)
elm_code_widget_alpha_set(obj, _edi_project_config->gui.alpha);
else
elm_code_widget_alpha_set(obj, 255);

View File

@ -59,6 +59,9 @@ Edi_Theme *edi_theme_theme_by_name(const char *name);
void edi_theme_window_alpha_set(void);
void edi_theme_elm_code_alpha_set(Evas_Object *obj);
void edi_theme_main_box_set(Evas_Object *box);
Evas_Object *edi_theme_main_box_get(void);
/**
* @}
*/