elementary: Simplifies code and removes redundant duplicated code.
authorCedric BAIL <cedric.bail@free.fr>
Thu, 4 Oct 2012 02:43:57 +0000 (02:43 +0000)
committerCedric BAIL <cedric.bail@free.fr>
Thu, 4 Oct 2012 02:43:57 +0000 (02:43 +0000)
Patch by Igor Murzov <e-mail@date.by>

SVN revision: 77396

src/lib/elm_check.c
src/lib/elm_menu.c
src/lib/elm_toolbar.c

index 376c5ac..6ba5397 100644 (file)
@@ -41,27 +41,13 @@ _activate(Evas_Object *obj)
      {
         elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
         if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
-          {
-             if (!elm_layout_text_get(obj, "on"))
-               {
-                  _elm_access_say(E_("State: On"));
-               }
-             else
-               _elm_access_say(E_("State: On"));
-          }
+             _elm_access_say(E_("State: On"));
      }
    else
      {
         elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
         if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
-          {
-             if (!elm_layout_text_get(obj, "off"))
-               {
-                  _elm_access_say(E_("State: Off"));
-               }
-             else
-               _elm_access_say(E_("State: Off"));
-          }
+             _elm_access_say(E_("State: Off"));
      }
 
    evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
index 505c099..2d4e226 100644 (file)
@@ -110,8 +110,6 @@ _submenu_sizing_eval(Elm_Menu_Item *parent_it)
 
    if (y_p + bh > py + ph)
      y_p -= y_p + bh - (py + ph);
-   if (y_p < py)
-     y_p += y_p - y_p;
 
    evas_object_move(parent_it->submenu.location, x_p, y_p);
    evas_object_resize(parent_it->submenu.location, bw, h_p);
@@ -149,10 +147,10 @@ _sizing_eval(Evas_Object *obj)
    if (elm_widget_mirrored_get(obj)) x_p -= w_p;
 
    if (x_p + bw > x2 + w2) x_p -= x_p + bw - (x2 + w2);
-   if (x_p < x2) x_p += x2 - x_p;
+   if (x_p < x2) x_p = x2;
 
    if (y_p + h_p + bh > y2 + h2) y_p -= y_p + h_p + bh - (y2 + h2);
-   if (y_p < y2) y_p += y2 - y_p;
+   if (y_p < y2) y_p = y2;
 
    evas_object_move(sd->location, x_p, y_p);
    evas_object_resize(sd->location, bw, h_p);
index e4a4580..857bb04 100644 (file)
@@ -833,16 +833,8 @@ _sizing_eval(Evas_Object *obj)
 
    if (sd->shrink_mode == ELM_TOOLBAR_SHRINK_NONE)
      {
-        if (sd->vertical)
-          {
-             minw = minw_bx + (w - vw);
-             minh = minh_bx + (h - vh);
-          }
-        else
-          {
-             minw = minw_bx + (w - vw);
-             minh = minh_bx + (h - vh);
-          }
+        minw = minw_bx + (w - vw);
+        minh = minh_bx + (h - vh);
      }
    else if (sd->shrink_mode == ELM_TOOLBAR_SHRINK_EXPAND)
      {