ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=bdcd034af546313f496cf30188539e77915488ff

commit bdcd034af546313f496cf30188539e77915488ff
Author: Andy Williams <a...@andywilliams.me>
Date:   Thu Dec 7 23:36:46 2017 +0000

    elm_code: Update background handling to work with transparency better
---
 src/bin/elementary/test_code.c       |  8 +++++---
 src/lib/elementary/elm_code_widget.c | 16 ++--------------
 2 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/src/bin/elementary/test_code.c b/src/bin/elementary/test_code.c
index 81b68812a8..ab7c8d346f 100644
--- a/src/bin/elementary/test_code.c
+++ b/src/bin/elementary/test_code.c
@@ -5,12 +5,15 @@
 
 static Evas_Object *_test_code_win_create(const char *id, const char *name)
 {
-   Evas_Object *win;
+   Evas_Object *win, *bg;
 
    win = elm_win_add(NULL, id, ELM_WIN_BASIC);
    elm_win_title_set(win, name);
    elm_win_autodel_set(win, EINA_TRUE);
-   elm_win_alpha_set(win, EINA_TRUE);
+
+   bg = elm_bg_add(win);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
 
    evas_object_resize(win, 360 * elm_config_scale_get(), 220 * 
elm_config_scale_get());
    return win;
@@ -96,7 +99,6 @@ _elm_code_test_editor_setup(Evas_Object *parent, Eina_Bool 
log)
    elm_obj_code_widget_editable_set(widget, EINA_TRUE);
    elm_obj_code_widget_show_whitespace_set(widget, EINA_TRUE);
    elm_obj_code_widget_line_numbers_set(widget, EINA_TRUE);
-   elm_obj_code_widget_alpha_set(widget, 200);
 
    if (!log)
      {
diff --git a/src/lib/elementary/elm_code_widget.c 
b/src/lib/elementary/elm_code_widget.c
index 927ebc9941..658d975024 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -2203,19 +2203,13 @@ _elm_code_widget_elm_widget_theme_apply(Eo *obj, 
Elm_Code_Widget_Data *pd)
    int r, g, b, a;
    double fade;
    unsigned int i;
-   Evas_Object *grid, *background;
+   Evas_Object *grid;
 
    edje = elm_layout_edje_get(obj);
    edje_object_color_class_get(edje, "elm/code/status/default", &r, &g, &b, &a,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
 
    fade = (double) pd->alpha / 255;
-   background = elm_object_part_content_get(pd->scroller, 
"elm.swallow.background");
-   evas_object_color_set(background, r * fade, g * fade, b * fade, a * fade);
-
-   if (fade < 1.0)
-     evas_object_color_set(obj, 1, 1, 1, 1); // setting 0 alpha is not working
-
    for (i = 0; i < eina_list_count(pd->grids); i++)
      {
         grid = eina_list_nth(pd->grids, i);
@@ -2242,7 +2236,7 @@ _elm_code_widget_alpha_set(Eo *obj, Elm_Code_Widget_Data 
*pd, int alpha)
 EOLIAN static void
 _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd)
 {
-   Evas_Object *background, *gridrows, *scroller;
+   Evas_Object *gridrows, *scroller;
    const char *fontname, *fontsize;
 
    efl_canvas_group_add(efl_super(obj, ELM_CODE_WIDGET_CLASS));
@@ -2260,12 +2254,6 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, 
Elm_Code_Widget_Data *pd)
    elm_object_focus_allow_set(scroller, EINA_FALSE);
    pd->scroller = scroller;
 
-   background = elm_bg_add(scroller);
-   evas_object_size_hint_weight_set(background, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(background, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   evas_object_show(background);
-   elm_object_part_content_set(scroller, "elm.swallow.background", background);
-
    fontname = edje_object_data_get(elm_layout_edje_get(obj), "font.name");
    fontsize = edje_object_data_get(elm_layout_edje_get(obj), "font.size");
    if (fontname && fontsize)

-- 


Reply via email to