Small patch from morlenxus to provide option that will allow an auto-hide
shelf to "unhide" via mouse_in or mouse_click. SVN revision: 30299
This commit is contained in:
parent
34ce52f83c
commit
458a6b12b8
|
@ -126,6 +126,7 @@ e_config_init(void)
|
|||
E_CONFIG_VAL(D, T, size, INT);
|
||||
E_CONFIG_VAL(D, T, overlap, INT);
|
||||
E_CONFIG_VAL(D, T, autohide, INT);
|
||||
E_CONFIG_VAL(D, T, autohide_show_action, INT);
|
||||
E_CONFIG_VAL(D, T, hide_timeout, FLOAT);
|
||||
E_CONFIG_VAL(D, T, hide_duration, FLOAT);
|
||||
|
||||
|
@ -1173,7 +1174,7 @@ e_config_init(void)
|
|||
{
|
||||
E_Config_Shelf *cf_es;
|
||||
|
||||
#define CFG_SHELF(_name, _con, _zone, _pop, _lay, _orient, _fita, _fits, _style, _size, _overlap, _autohide, _hide_timeout, _hide_duration) \
|
||||
#define CFG_SHELF(_name, _con, _zone, _pop, _lay, _orient, _fita, _fits, _style, _size, _overlap, _autohide, _autohide_show_action, _hide_timeout, _hide_duration) \
|
||||
cf_es = E_NEW(E_Config_Shelf, 1); \
|
||||
cf_es->name = evas_stringshare_add(_name); \
|
||||
cf_es->container = _con; \
|
||||
|
@ -1187,32 +1188,33 @@ e_config_init(void)
|
|||
cf_es->size = _size; \
|
||||
cf_es->overlap = _overlap; \
|
||||
cf_es->autohide = _autohide; \
|
||||
cf_es->autohide_show_action = _autohide_show_action; \
|
||||
cf_es->hide_timeout = _hide_timeout; \
|
||||
cf_es->hide_duration = _hide_duration; \
|
||||
e_config->shelves = evas_list_append(e_config->shelves, cf_es)
|
||||
/* shelves for 4 zones on head 0 by default */
|
||||
CFG_SHELF("shelf", 0, 0,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0, 0, 1.0, 1.0);
|
||||
1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
|
||||
CFG_SHELF("shelf", 0, 1,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0, 0, 1.0, 1.0);
|
||||
1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
|
||||
CFG_SHELF("shelf", 0, 2,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0, 0, 1.0, 1.0);
|
||||
1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
|
||||
CFG_SHELF("shelf", 0, 3,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0, 0, 1.0, 1.0);
|
||||
1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
|
||||
/* shelves for heada 1, 2, and 3 by default */
|
||||
CFG_SHELF("shelf", 1, 0,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0, 0, 1.0, 1.0);
|
||||
1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
|
||||
CFG_SHELF("shelf", 2, 0,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0, 0, 1.0, 1.0);
|
||||
1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
|
||||
CFG_SHELF("shelf", 3, 0,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0, 0, 1.0, 1.0);
|
||||
1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
|
||||
}
|
||||
IFCFGEND;
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ struct _E_Config_Dialog_Data
|
|||
int layering;
|
||||
int overlapping;
|
||||
int autohiding;
|
||||
int autohiding_show_action;
|
||||
double hide_timeout;
|
||||
double hide_duration;
|
||||
};
|
||||
|
@ -119,6 +120,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
|||
cfdata->size = cfdata->escfg->size;
|
||||
cfdata->overlapping = cfdata->escfg->overlap;
|
||||
cfdata->autohiding = cfdata->escfg->autohide;
|
||||
cfdata->autohiding_show_action = cfdata->escfg->autohide_show_action;
|
||||
cfdata->hide_timeout = cfdata->escfg->hide_timeout;
|
||||
cfdata->hide_duration = cfdata->escfg->hide_duration;
|
||||
if (cfdata->size <= 24)
|
||||
|
@ -344,6 +346,7 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|||
cfdata->escfg->overlap = cfdata->overlapping;
|
||||
|
||||
cfdata->escfg->autohide = cfdata->autohiding;
|
||||
cfdata->escfg->autohide_show_action = cfdata->autohiding_show_action;
|
||||
cfdata->escfg->hide_timeout = cfdata->hide_timeout;
|
||||
cfdata->escfg->hide_duration = cfdata->hide_duration;
|
||||
if (cfdata->escfg->autohide && !cfdata->es->hidden)
|
||||
|
@ -494,6 +497,11 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
|||
of = e_widget_framelist_add(evas, _("Autohide"), 0);
|
||||
ob = e_widget_check_add(evas, _("Auto-hide the shelf"), &(cfdata->autohiding));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
rg = e_widget_radio_group_new(&(cfdata->autohiding_show_action));
|
||||
ob = e_widget_radio_add(evas, _("Show on mouse in"), 0, rg);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_radio_add(evas, _("Show on mouse click"), 1, rg);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_label_add(evas, _("Hide timeout"));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_slider_add(evas, 1, 0, _("%.1f seconds"), 0.2, 6.0, 0.2, 0, &(cfdata->hide_timeout), NULL, 100);
|
||||
|
|
|
@ -179,17 +179,15 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, i
|
|||
snprintf(buf, sizeof(buf), "%i", es->id);
|
||||
es->gadcon = e_gadcon_swallowed_new(es->name, buf, es->o_base, "e.swallow.content");
|
||||
e_gadcon_min_size_request_callback_set(es->gadcon,
|
||||
_e_shelf_gadcon_min_size_request,
|
||||
es);
|
||||
_e_shelf_gadcon_min_size_request, es);
|
||||
|
||||
e_gadcon_size_request_callback_set(es->gadcon,
|
||||
_e_shelf_gadcon_size_request,
|
||||
es);
|
||||
_e_shelf_gadcon_size_request, es);
|
||||
e_gadcon_frame_request_callback_set(es->gadcon,
|
||||
_e_shelf_gadcon_frame_request,
|
||||
es);
|
||||
_e_shelf_gadcon_frame_request, es);
|
||||
e_gadcon_orient(es->gadcon, E_GADCON_ORIENT_TOP);
|
||||
snprintf(buf, sizeof(buf), "e,state,orientation,%s", _e_shelf_orient_string_get(es));
|
||||
snprintf(buf, sizeof(buf), "e,state,orientation,%s",
|
||||
_e_shelf_orient_string_get(es));
|
||||
edje_object_signal_emit(es->o_base, buf, "e");
|
||||
edje_object_message_signal_process(es->o_base);
|
||||
e_gadcon_zone_set(es->gadcon, zone);
|
||||
|
@ -203,8 +201,7 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, i
|
|||
else
|
||||
e_gadcon_dnd_window_set(es->gadcon, zone->container->event_win);
|
||||
e_gadcon_util_menu_attach_func_set(es->gadcon,
|
||||
_e_shelf_cb_menu_items_append,
|
||||
es);
|
||||
_e_shelf_cb_menu_items_append, es);
|
||||
|
||||
shelves = evas_list_append(shelves, es);
|
||||
shelves = evas_list_sort(shelves, -1, _e_shelf_cb_id_sort);
|
||||
|
@ -1143,18 +1140,21 @@ _e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_inf
|
|||
{
|
||||
Evas_Event_Mouse_Down *ev;
|
||||
E_Shelf *es;
|
||||
E_Menu *mn;
|
||||
int cx, cy, cw, ch;
|
||||
|
||||
es = data;
|
||||
ev = event_info;
|
||||
if (ev->button == 3)
|
||||
switch (ev->button)
|
||||
{
|
||||
E_Menu *mn;
|
||||
int cx, cy, cw, ch;
|
||||
|
||||
case 1:
|
||||
if (es->cfg->autohide_show_action) e_shelf_toggle (es, 1);
|
||||
break;
|
||||
case 3:
|
||||
mn = e_menu_new();
|
||||
e_menu_post_deactivate_callback_set(mn, _e_shelf_cb_menu_post, es);
|
||||
es->menu = mn;
|
||||
|
||||
|
||||
_e_shelf_menu_append(es, mn);
|
||||
|
||||
e_gadcon_canvas_zone_geometry_get(es->gadcon, &cx, &cy, &cw, &ch);
|
||||
|
@ -1162,8 +1162,8 @@ _e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_inf
|
|||
e_util_zone_current_get(e_manager_current_get()),
|
||||
cx + ev->output.x, cy + ev->output.y, 1, 1,
|
||||
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
||||
e_util_evas_fake_mouse_up_later(es->gadcon->evas,
|
||||
ev->button);
|
||||
e_util_evas_fake_mouse_up_later(es->gadcon->evas, ev->button);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1174,7 +1174,7 @@ _e_shelf_cb_mouse_in(void *data, Evas *evas, Evas_Object *obj, void *event_info)
|
|||
|
||||
es = data;
|
||||
edje_object_signal_emit(es->o_base, "e,state,focused", "e");
|
||||
e_shelf_toggle(es, 1);
|
||||
if (!es->cfg->autohide_show_action) e_shelf_toggle (es, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue