forked from enlightenment/enlightenment
teamwork action can now show any uri on demand
This commit is contained in:
parent
ef0f3322ad
commit
1d2b1340a9
|
@ -93,12 +93,20 @@ e_tw_config_dd_new(void)
|
|||
}
|
||||
//////////////////////////////
|
||||
static void
|
||||
e_tw_act_toggle_cb(E_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
|
||||
e_tw_act_toggle_cb(E_Object *obj EINA_UNUSED, const char *params)
|
||||
{
|
||||
if (!tw_mod->pop) return;
|
||||
if (tw_mod->sticky)
|
||||
tw_hide(NULL);
|
||||
tw_mod->sticky = !tw_mod->sticky;
|
||||
if (tw_mod->pop)
|
||||
{
|
||||
if (tw_mod->sticky)
|
||||
tw_hide(NULL);
|
||||
tw_mod->sticky = !tw_mod->sticky;
|
||||
return;
|
||||
}
|
||||
if (params && params[0])
|
||||
{
|
||||
tw_uri_show(params);
|
||||
tw_mod->sticky = 1;
|
||||
}
|
||||
}
|
||||
//////////////////////////////
|
||||
EAPI void *
|
||||
|
@ -146,7 +154,7 @@ e_modapi_init(E_Module *m)
|
|||
}
|
||||
e_tw_toggle = e_action_add(_act_toggle);
|
||||
e_tw_toggle->func.go = e_tw_act_toggle_cb;
|
||||
e_action_predef_name_set(_e_tw_name, _lbl_toggle, _act_toggle, NULL, NULL, 0);
|
||||
e_action_predef_name_set(_e_tw_name, _lbl_toggle, _act_toggle, NULL, NULL, 1);
|
||||
|
||||
e_configure_option_domain_current_set("teamwork");
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ EINTERN int e_tw_init(void);
|
|||
EINTERN void e_tw_shutdown(void);
|
||||
EINTERN Eina_Bool tw_hide(void *d EINA_UNUSED);
|
||||
EINTERN void tw_popup_opacity_set(void);
|
||||
EINTERN void tw_uri_show(const char *uri);
|
||||
|
||||
EINTERN E_Config_Dialog *e_int_config_teamwork_module(E_Container *con, const char *params EINA_UNUSED);
|
||||
|
||||
|
|
|
@ -812,7 +812,7 @@ tw_show_helper(Evas_Object *o, int w, int h)
|
|||
if (py + ph > tw_mod->pop->zone->h)
|
||||
py = tw_mod->pop->zone->h - ph;
|
||||
}
|
||||
else
|
||||
else if (tw_win)
|
||||
{
|
||||
E_Border *bd = e_border_find_by_client_window(tw_win);
|
||||
int x, y;
|
||||
|
@ -839,6 +839,11 @@ tw_show_helper(Evas_Object *o, int w, int h)
|
|||
/* give up */
|
||||
if (py < 0) py = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
px = (tw_mod->pop->zone->w / 2) - (pw / 2);
|
||||
py = (tw_mod->pop->zone->h / 2) - (pw / 2);
|
||||
}
|
||||
e_popup_move_resize(tw_mod->pop, px, py, pw, ph);
|
||||
e_popup_content_set(tw_mod->pop, o);
|
||||
e_popup_show(tw_mod->pop);
|
||||
|
@ -1264,3 +1269,9 @@ e_tw_shutdown(void)
|
|||
eina_hash_free(tw_mod->media);
|
||||
E_FREE_FUNC(tw_mod->pop, e_object_del);
|
||||
}
|
||||
|
||||
EINTERN void
|
||||
tw_uri_show(const char *uri)
|
||||
{
|
||||
dbus_link_show_helper(uri, 1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue