[slider] - show popup on left/right/up/down key down press and hide popup on left/right/up/down key up press.

Test Plan: elementary_test->slider

Reviewers: seoz, Hermet

Differential Revision: https://phab.enlightenment.org/D275
This commit is contained in:
Amitesh Singh 2013-10-23 16:42:04 +09:00 committed by Daniel Juyung Seo
parent fae1dc109e
commit 329eb907f1
3 changed files with 23 additions and 0 deletions

View File

@ -1715,3 +1715,7 @@
2013-10-21 Ryuan Choi (ryuan)
* fileselector : Monitor and update changes of selected path automatically while EIO is working.
2013-10-22 Amitesh Singh (_ami_)
* slider : Show popup on left/right/up/down key down press and hide on left/right/up/down key up press.

View File

@ -102,6 +102,7 @@ Additions:
Improvements:
* Slider : Show popup on left/right/up/down key down press and hide on left/right/up/down key up press.
* Default theme is now dark (matching Enlightenment).
* Toolbar widget is now a scrollable widget.
* Entry widget is now a scrollable layout.

18
legacy/elementary/src/lib/elm_slider.c Normal file → Executable file
View File

@ -370,6 +370,23 @@ _elm_slider_smart_event(Eo *obj, void *_pd, va_list *list)
if (elm_widget_disabled_get(obj)) return;
if (type == EVAS_CALLBACK_KEY_DOWN) goto key_down;
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;
}
else if (type != EVAS_CALLBACK_MOUSE_WHEEL)
return;
@ -425,6 +442,7 @@ key_down:
else return;
success:
_popup_show(obj, NULL, NULL, NULL);
_slider_update(obj, EINA_TRUE);
if (ret) *ret = EINA_TRUE;