slider: removed unnecessary key value check in case of key up event
authorJaeun Choi <jaeun12.choi@samsung.com>
Fri, 18 Apr 2014 02:53:27 +0000 (11:53 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Fri, 18 Apr 2014 02:53:27 +0000 (11:53 +0900)
Summary:
This patch removes unnecessary codes.
There is no need to check key value in case of key up event,
since any other key down event except direction keys will cancel sliding.
Instead, hide popup if the popup is visible at that point.

Test Plan: None

Reviewers: Hermet, raster

Reviewed By: Hermet

Differential Revision: https://phab.enlightenment.org/D760

src/lib/elm_slider.c

index 02a6d7f4e8c985eb3b6939b0dba0392065c55816..3faf69b254f091bf0eea22cc73e330b7863864bc 100644 (file)
@@ -393,20 +393,9 @@ _elm_slider_elm_widget_event(Eo *obj, Elm_Slider_Data *sd, Evas_Object *src, Eva
      }
    else if (type == EVAS_CALLBACK_KEY_UP)
      {
-         Evas_Event_Key_Up *ev_up =  event_info;
-
-         if ((!ev_up->string) &&
-             ((!strcmp(ev_up->key, "Left")) ||
-              (!strcmp(ev_up->key, "KP_Left")) ||
-              (!strcmp(ev_up->key, "Right")) ||
-              (!strcmp(ev_up->key, "KP_Right")) ||
-              (!strcmp(ev_up->key, "Up")) ||
-              (!strcmp(ev_up->key, "KP_Up")) ||
-              (!strcmp(ev_up->key, "Down")) ||
-              (!strcmp(ev_up->key, "KP_Down"))))
-             _popup_hide(obj, NULL, NULL, NULL);
-
-         return EINA_FALSE;
+        if (evas_object_visible_get(sd->popup))
+          _popup_hide(obj, NULL, NULL, NULL);
+        return EINA_FALSE;
      }
    else if (type == EVAS_CALLBACK_MOUSE_WHEEL)
      {