Enlightenment CVS committal Author : urandom Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_int_shelf_config.c e_shelf.c e_shelf.h Log Message: show/hide the shelf when the autohide option is changed. hide the hide-able shelves on startup =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_int_shelf_config.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- e_int_shelf_config.c 25 Mar 2007 22:45:00 -0000 1.25 +++ e_int_shelf_config.c 6 Apr 2007 20:23:45 -0000 1.26 @@ -338,16 +338,10 @@ cfdata->escfg->overlap = cfdata->overlapping; cfdata->escfg->autohide = cfdata->autohiding; - if (cfdata->escfg->autohide) - { - edje_object_signal_emit(cfdata->es->o_base, "e,state,hidden", "e"); - cfdata->es->hidden = 1; - } - else - { - edje_object_signal_emit(cfdata->es->o_base, "e,state,visible", "e"); - cfdata->es->hidden = 0; - } + if (cfdata->escfg->autohide && !cfdata->es->hidden) + e_shelf_toggle(cfdata->es, 0); + else if (!cfdata->escfg->autohide && cfdata->es->hidden) + e_shelf_toggle(cfdata->es, 1); if (restart) { =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_shelf.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -3 -r1.52 -r1.53 --- e_shelf.c 6 Apr 2007 19:01:29 -0000 1.52 +++ e_shelf.c 6 Apr 2007 20:23:45 -0000 1.53 @@ -83,6 +83,7 @@ e_shelf_position_calc(es); e_shelf_populate(es); e_shelf_show(es); + e_shelf_toggle(es, 0); } } } @@ -192,6 +193,7 @@ shelves = evas_list_append(shelves, es); shelves = evas_list_sort(shelves, -1, _e_shelf_cb_id_sort); + es->hidden = 0; es->hide_step = 0; es->hide_timer = NULL; es->hide_animator = NULL; @@ -257,6 +259,31 @@ } EAPI void +e_shelf_toggle(E_Shelf *es, int show) +{ + E_OBJECT_CHECK(es); + E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE); + if (show && es->hidden) + { + es->hidden = 0; + edje_object_signal_emit(es->o_base, "e,state,visible", "e"); + if(!es->hide_animator) + es->hide_animator = ecore_animator_add(_e_shelf_cb_hide_animator, es); + if (es->hide_timer) + { + ecore_timer_del(es->hide_timer); + es->hide_timer = NULL; + } + } + else if (!show && es->cfg->autohide && !es->hidden) + { + es->hidden = 1; + if(!es->hide_timer) + es->hide_timer = ecore_timer_add(1.0, _e_shelf_cb_hide_timer, es); + } +} + +EAPI void e_shelf_move(E_Shelf *es, int x, int y) { E_OBJECT_CHECK(es); @@ -1009,21 +1036,7 @@ es = data; ev = event_info; edje_object_signal_emit(es->o_base, "e,state,focused", "e"); - if (es->cfg->autohide) - { - if (es->hidden) - { - es->hidden = 0; - edje_object_signal_emit(es->o_base, "e,state,visible", "e"); - if(!es->hide_animator) - es->hide_animator = ecore_animator_add(_e_shelf_cb_hide_animator, es); - if (es->hide_timer) - { - ecore_timer_del(es->hide_timer); - es->hide_timer = NULL; - } - } - } + e_shelf_toggle(es, 1); } static void @@ -1040,14 +1053,7 @@ evas_object_geometry_get(es->o_base, &x, &y, &w, &h); if (!E_INSIDE(ev->canvas.x, ev->canvas.y, x, y, w, h)) - { - if(!es->hidden) - { - es->hidden = 1; - if(!es->hide_timer) - es->hide_timer = ecore_timer_add(1.0, _e_shelf_cb_hide_timer, es); - } - } + e_shelf_toggle(es, 0); } edje_object_signal_emit(es->o_base, "e,state,unfocused", "e"); } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_shelf.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- e_shelf.h 6 Apr 2007 19:01:29 -0000 1.18 +++ e_shelf.h 6 Apr 2007 20:23:45 -0000 1.19 @@ -49,6 +49,7 @@ EAPI void e_shelf_populate(E_Shelf *es); EAPI void e_shelf_show(E_Shelf *es); EAPI void e_shelf_hide(E_Shelf *es); +EAPI void e_shelf_toggle(E_Shelf *es, int show); EAPI void e_shelf_move(E_Shelf *es, int x, int y); EAPI void e_shelf_resize(E_Shelf *es, int w, int h); EAPI void e_shelf_move_resize(E_Shelf *es, int x, int y, int w, int h); ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs