summaryrefslogtreecommitdiff
path: root/src/bin/e_widget_toolbar.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2010-02-05 10:22:21 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-02-05 10:22:21 +0000
commit00e6bf4bf1e78f43354f0fb44b5d753d8968fefa (patch)
treed7199a461315eee03bf199a0ef04311ecc05356d /src/bin/e_widget_toolbar.c
parent83667835bc936dc48dc4a5b98f045ece735cdaf5 (diff)
make back./fwd arrow actuall advance items in toolbar
SVN revision: 45894
Diffstat (limited to 'src/bin/e_widget_toolbar.c')
-rw-r--r--src/bin/e_widget_toolbar.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/bin/e_widget_toolbar.c b/src/bin/e_widget_toolbar.c
index 37e1bd9..34e57be 100644
--- a/src/bin/e_widget_toolbar.c
+++ b/src/bin/e_widget_toolbar.c
@@ -29,6 +29,8 @@ static void _e_wid_disable_hook(Evas_Object *obj);
29static void _e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source); 29static void _e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source);
30static void _e_wid_cb_scrollframe_resize(void *data, Evas *e, Evas_Object *obj, void *event_info); 30static void _e_wid_cb_scrollframe_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
31static void _e_wid_cb_key_down(void *data, Evas *evas, Evas_Object *obj, void *event_info); 31static void _e_wid_cb_key_down(void *data, Evas *evas, Evas_Object *obj, void *event_info);
32static void _e_wid_signal_prev(void *data, Evas_Object *obj, const char *emission, const char *source);
33static void _e_wid_signal_next(void *data, Evas_Object *obj, const char *emission, const char *source);
32static void _item_show(Item *it); 34static void _item_show(Item *it);
33static void _item_select(Item *it); 35static void _item_select(Item *it);
34static void _item_unselect(Item *it); 36static void _item_unselect(Item *it);
@@ -71,6 +73,13 @@ e_widget_toolbar_add(Evas *evas, int icon_w, int icon_h)
71 _e_wid_focus_steal, obj); 73 _e_wid_focus_steal, obj);
72 evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, 74 evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN,
73 _e_wid_cb_key_down, obj); 75 _e_wid_cb_key_down, obj);
76
77 edje_object_signal_callback_add(e_scrollframe_edje_object_get(o),
78 "e,action,prev", "e",
79 _e_wid_signal_prev, obj);
80 edje_object_signal_callback_add(e_scrollframe_edje_object_get(o),
81 "e,action,next", "e",
82 _e_wid_signal_next, obj);
74 evas_object_show(o); 83 evas_object_show(o);
75 e_widget_sub_object_add(obj, o); 84 e_widget_sub_object_add(obj, o);
76 e_widget_resize_object_set(obj, o); 85 e_widget_resize_object_set(obj, o);
@@ -327,6 +336,56 @@ _e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char
327} 336}
328 337
329static void 338static void
339_e_wid_signal_prev(void *data, Evas_Object *obj, const char *emission, const char *source)
340{
341 E_Widget_Data *wd;
342 Eina_List *l, *l2;
343 Item *it = NULL, *it2 = NULL;
344
345 wd = e_widget_data_get(data);
346 if ((!wd->o_base) || (!wd->o_box)) return;
347 EINA_LIST_FOREACH(wd->items, l, it)
348 {
349 if (it->selected)
350 {
351 l2 = eina_list_prev(l);
352 if (l2) it2 = eina_list_data_get(l2);
353 break;
354 }
355 }
356 if ((it) && (it2) && (it != it2))
357 {
358 _item_unselect(it);
359 _item_select(it2);
360 }
361}
362
363static void
364_e_wid_signal_next(void *data, Evas_Object *obj, const char *emission, const char *source)
365{
366 E_Widget_Data *wd;
367 Eina_List *l, *l2;
368 Item *it = NULL, *it2 = NULL;
369
370 wd = e_widget_data_get(data);
371 if ((!wd->o_base) || (!wd->o_box)) return;
372 EINA_LIST_FOREACH(wd->items, l, it)
373 {
374 if (it->selected)
375 {
376 l2 = eina_list_next(l);
377 if (l2) it2 = eina_list_data_get(l2);
378 break;
379 }
380 }
381 if ((it) && (it2) && (it != it2))
382 {
383 _item_unselect(it);
384 _item_select(it2);
385 }
386}
387
388static void
330_e_wid_cb_scrollframe_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) 389_e_wid_cb_scrollframe_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
331{ 390{
332 E_Widget_Data *wd; 391 E_Widget_Data *wd;