From: Enlightenment S. <no-...@en...> - 2012-03-24 23:35:52
|
Log: adapting to some focus changes Author: urandom Date: 2012-03-24 16:35:42 -0700 (Sat, 24 Mar 2012) New Revision: 69604 Trac: http://trac.enlightenment.org/e/changeset/69604 Modified: trunk/edje_viewer/src/bin/edje_viewer_gui.c Modified: trunk/edje_viewer/src/bin/edje_viewer_gui.c =================================================================== --- trunk/edje_viewer/src/bin/edje_viewer_gui.c 2012-03-24 18:58:09 UTC (rev 69603) +++ trunk/edje_viewer/src/bin/edje_viewer_gui.c 2012-03-24 23:35:42 UTC (rev 69604) @@ -37,6 +37,7 @@ static void on_win_del_req(void *data, Evas_Object *obj, void *event_info); static void on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void on_toggles_win_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info); static Eina_Bool on_typebuf_timer(void *data); static void on_group_check_changed(void *data, Evas_Object *obj, void *event_info); static void on_toolbar_changed(void *data, Evas_Object *obj, void *event_info); @@ -622,6 +623,8 @@ v->gui.toggles_win = o = elm_win_inwin_add(v->gui.win); elm_object_style_set(o, "minimal_vertical"); + evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, + on_toggles_win_key_down, v); bx = elm_box_add(v->gui.toggles_win); evas_object_show(bx); @@ -764,7 +767,7 @@ Viewer *v = data; Evas_Event_Key_Down *ev = event_info; - if (evas_focus_get(e) != v->gui.ly) + if (evas_focus_get(e) == v->gui.entry) return; if (!strcmp(ev->keyname, "F9")) @@ -797,6 +800,16 @@ } } +static void +on_toggles_win_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Viewer *v = data; + Evas_Event_Key_Down *ev = event_info; + + if (!strcmp(ev->keyname, "F9")) + show_toggles(v); +} + static Eina_Bool on_typebuf_timer(void *data) { |