From: SooChan Lim Date: Wed, 15 Jan 2025 07:31:23 +0000 (+0900) Subject: e_comp_object: simplify the theme code X-Git-Tag: accepted/tizen/unified/20250120.004729~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=555c45a626cc148f34c597a1bf1b654264179f5b;p=platform%2Fupstream%2Fenlightenment.git e_comp_object: simplify the theme code simplify the edje theme setting code Change-Id: I9610e1d271bb9893916560e58afd02a2b333b57f --- diff --git a/src/bin/compmgr/e_comp_object.c b/src/bin/compmgr/e_comp_object.c index 04153667b2..c4c8369626 100644 --- a/src/bin/compmgr/e_comp_object.c +++ b/src/bin/compmgr/e_comp_object.c @@ -869,13 +869,12 @@ _e_comp_object_shadow_client_match(const E_Client *ec, E_Comp_Match *m) static Eina_Bool _e_comp_object_shadow_setup(E_Comp_Object *cw) { - int ok = 0; Eina_List *list = NULL, *l; E_Input_Rect_Data *input_rect_data; E_Input_Rect_Smart_Data *input_rect_sd; E_Comp_Match *m; Eina_Stringshare *reshadow_group = NULL; - Eina_Bool focus = EINA_FALSE, skip = EINA_FALSE, fast = EINA_FALSE, reshadow = EINA_FALSE, no_shadow = EINA_FALSE, pass_event_flag = EINA_FALSE; + Eina_Bool focus = EINA_FALSE, skip = EINA_FALSE, no_shadow = EINA_FALSE, pass_event_flag = EINA_FALSE; Eina_Stringshare *name, *title; E_Comp_Config *conf = e_comp_config_get(); @@ -885,7 +884,6 @@ _e_comp_object_shadow_setup(E_Comp_Object *cw) name = cw->ec->icccm.name; title = cw->ec->icccm.title; skip = (cw->ec->override ? conf->match.disable_overrides : conf->match.disable_borders) || (title && (!strncmp(title, "noshadow", 8))); - fast = cw->ec->override ? conf->fast_overrides : conf->fast_borders; /* skipping here is mostly a hack for systray because I hate it */ if (!skip) @@ -901,37 +899,9 @@ _e_comp_object_shadow_setup(E_Comp_Object *cw) no_shadow = m->no_shadow; } } - while (!ok) - { - if (skip) - { - reshadow = ok = !e_util_strcmp(reshadow_group, "e/comp/frame/none"); - if (!ok) - ok = e_theme_edje_object_set(cw->shobj, "base/theme/comp", "e/comp/frame/none"); - } - if (ok) break; - if (!ok) - { - if (fast) - { - reshadow = ok = !e_util_strcmp(reshadow_group, "e/comp/frame/default/fast"); - if (!ok) - ok = e_theme_edje_object_set(cw->shobj, "base/theme/comp", "e/comp/frame/default/fast"); - } - if (!ok) - { - reshadow = ok = !e_util_strcmp(reshadow_group, "e/comp/frame/default"); - if (!ok) - ok = e_theme_edje_object_set(cw->shobj, "base/theme/comp", "e/comp/frame/default"); - } - } - break; - } - /* reshadow means this entire function call has been a no-op since we're re-setting the current style */ - if (reshadow) - { - ; - } + + e_theme_edje_object_set(cw->shobj, NULL, "e/comp/frame/none"); + if (cw->ec->override) { if ((!cw->ec->shaped) && (!no_shadow) && (!cw->ec->argb)) @@ -3083,7 +3053,6 @@ e_comp_object_util_add(Evas_Object *obj) Evas_Object *o; const char *name; Eina_Bool skip = EINA_FALSE; - int ok = 0; int x, y, w, h; Eina_Bool vis; @@ -3098,8 +3067,8 @@ e_comp_object_util_add(Evas_Object *obj) if (skip) evas_object_data_set(o, "comp_object_skip", (void*)1); - if (!ok) - e_theme_edje_object_set(o, "base/theme/comp", "e/comp/frame/default"); + e_theme_edje_object_set(o, "base/theme/comp", "e/comp/frame/default"); + if (e_util_strcmp(evas_object_type_get(obj), "edje") || (!edje_object_data_get(obj, "noshadow"))) edje_object_signal_emit(o, "e,state,shadow,on", "e"); else diff --git a/src/bin/core/e_view_edje.c b/src/bin/core/e_view_edje.c index 54676543e8..3a3fc9688f 100644 --- a/src/bin/core/e_view_edje.c +++ b/src/bin/core/e_view_edje.c @@ -564,7 +564,6 @@ e_view_edje_util_add(E_View *view) E_View *edje_view; const char *name; Eina_Bool skip = EINA_FALSE; - int ok = 0; int x, y, w, h; Eina_Bool vis; @@ -582,8 +581,8 @@ e_view_edje_util_add(E_View *view) if (skip) e_view_data_set(edje_view, "comp_object_skip", (void*)1); - if (!ok) - e_theme_edje_view_set(edje, NULL, "e/comp/frame/default"); + e_theme_edje_view_set(edje, NULL, "e/comp/frame/default"); + if ((view->type == E_VIEW_TYPE_EDJE) || (!e_view_edje_data_get(edje, "noshadow"))) e_view_edje_signal_emit(edje, "e,state,shadow,on", "e"); else