show/hide the shelf when the autohide option is changed. hide the hide-able shelves on startup

SVN revision: 29427
This commit is contained in:
Viktor Kojouharov 2007-04-06 20:23:45 +00:00
parent 641dd49248
commit 187c3fcec1
3 changed files with 34 additions and 33 deletions

View File

@ -338,16 +338,10 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
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)
{

View File

@ -83,6 +83,7 @@ e_shelf_config_init(void)
e_shelf_position_calc(es);
e_shelf_populate(es);
e_shelf_show(es);
e_shelf_toggle(es, 0);
}
}
}
@ -192,6 +193,7 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, i
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;
@ -256,6 +258,31 @@ e_shelf_hide(E_Shelf *es)
}
}
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)
{
@ -1009,21 +1036,7 @@ _e_shelf_cb_mouse_in(void *data, Evas *evas, Evas_Object *obj, void *event_info)
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 @@ _e_shelf_cb_mouse_out(void *data, Evas *evas, Evas_Object *obj, void *event_info
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");
}

View File

@ -49,6 +49,7 @@ EAPI void e_shelf_zone_move_resize_handle(E_Zone *zone);
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);