From: Cedric BAIL Date: Thu, 4 Oct 2012 02:43:57 +0000 (+0000) Subject: elementary: Simplifies code and removes redundant duplicated code. X-Git-Tag: submit/efl/20131021.015827~1683 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec45f2ea007ecc2e9d57f10662aa8a498912240e;p=platform%2Fupstream%2Felementary.git elementary: Simplifies code and removes redundant duplicated code. Patch by Igor Murzov SVN revision: 77396 --- diff --git a/src/lib/elm_check.c b/src/lib/elm_check.c index 376c5ac..6ba5397 100644 --- a/src/lib/elm_check.c +++ b/src/lib/elm_check.c @@ -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); diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c index 505c099..2d4e226 100644 --- a/src/lib/elm_menu.c +++ b/src/lib/elm_menu.c @@ -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); diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index e4a4580..857bb04 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -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) {