e_comp_object: simplify the theme code 94/318394/1
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 15 Jan 2025 07:31:23 +0000 (16:31 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Thu, 16 Jan 2025 08:30:59 +0000 (17:30 +0900)
simplify the edje theme setting code

Change-Id: I9610e1d271bb9893916560e58afd02a2b333b57f

src/bin/compmgr/e_comp_object.c
src/bin/core/e_view_edje.c

index 04153667b2af1ca64272087d2c5397daeb44bcf1..c4c8369626a93a5aa7afbfa617b4e17cf3462dcd 100644 (file)
@@ -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
index 54676543e8c3852367133941810bd6b401d19519..3a3fc9688fc4004e2912cf8eb362fe21d0ab6925 100644 (file)
@@ -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