Fix mouse,in being sent multiple times by using edje signals, not
evas_callbacks. Thanks rephorm :) SVN revision: 28343
This commit is contained in:
parent
747be7eb46
commit
9fc831fc96
54
net.edc
54
net.edc
|
@ -25,6 +25,7 @@ collections
|
|||
{
|
||||
name: "rx";
|
||||
type: IMAGE;
|
||||
mouse_events: 0;
|
||||
description
|
||||
{
|
||||
state: "default" 0.0;
|
||||
|
@ -44,22 +45,11 @@ collections
|
|||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part
|
||||
{
|
||||
name: "base";
|
||||
type: IMAGE;
|
||||
description
|
||||
{
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image.normal: "idle.png";
|
||||
}
|
||||
}
|
||||
part
|
||||
{
|
||||
name: "tx";
|
||||
type: IMAGE;
|
||||
mouse_events: 0;
|
||||
description
|
||||
{
|
||||
state: "default" 0.0;
|
||||
|
@ -79,9 +69,49 @@ collections
|
|||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part
|
||||
{
|
||||
name: "base";
|
||||
type: IMAGE;
|
||||
mouse_events: 0;
|
||||
description
|
||||
{
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image.normal: "idle.png";
|
||||
}
|
||||
}
|
||||
part
|
||||
{
|
||||
name: "overlay";
|
||||
type: RECT;
|
||||
repeat_events: 0;
|
||||
mouse_events: 1;
|
||||
description
|
||||
{
|
||||
state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs
|
||||
{
|
||||
program
|
||||
{
|
||||
name: "in";
|
||||
signal: "mouse,in";
|
||||
source: "overlay";
|
||||
action: SIGNAL_EMIT "e,action,mouse,in" "";
|
||||
}
|
||||
program
|
||||
{
|
||||
name: "out";
|
||||
signal: "mouse,out";
|
||||
source: "overlay";
|
||||
action: SIGNAL_EMIT "e,action,mouse,out" "";
|
||||
}
|
||||
program
|
||||
{
|
||||
name: "recv";
|
||||
|
|
|
@ -29,6 +29,10 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
|||
if (!e_theme_edje_object_set(inst->o_net, "base/theme/modules/net",
|
||||
"modules/net/main"))
|
||||
edje_object_file_set(inst->o_net, buf, "modules/net/main");
|
||||
edje_object_signal_callback_add(inst->o_net, "e,action,mouse,in", "",
|
||||
_cb_mouse_in, inst);
|
||||
edje_object_signal_callback_add(inst->o_net, "e,action,mouse,out", "",
|
||||
_cb_mouse_out, inst);
|
||||
evas_object_show(inst->o_net);
|
||||
|
||||
gcc = e_gadcon_client_new(gc, name, id, style, inst->o_net);
|
||||
|
@ -38,10 +42,6 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
|||
|
||||
evas_object_event_callback_add(inst->o_net, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_cb_mouse_down, inst);
|
||||
evas_object_event_callback_add(inst->o_net, EVAS_CALLBACK_MOUSE_IN,
|
||||
_cb_mouse_in, inst);
|
||||
evas_object_event_callback_add(inst->o_net, EVAS_CALLBACK_MOUSE_OUT,
|
||||
_cb_mouse_out, inst);
|
||||
|
||||
cfg->instances = evas_list_append(cfg->instances, inst);
|
||||
return gcc;
|
||||
|
@ -59,9 +59,9 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
|||
{
|
||||
evas_object_event_callback_del(inst->o_net, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_cb_mouse_down);
|
||||
evas_object_event_callback_del(inst->o_net, EVAS_CALLBACK_MOUSE_IN,
|
||||
edje_object_signal_callback_del(inst->o_net, "e,action,mouse,in", "",
|
||||
_cb_mouse_in);
|
||||
evas_object_event_callback_del(inst->o_net, EVAS_CALLBACK_MOUSE_OUT,
|
||||
edje_object_signal_callback_del(inst->o_net, "e,action,mouse,out", "",
|
||||
_cb_mouse_out);
|
||||
evas_object_del(inst->o_net);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ _cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event)
|
|||
else
|
||||
inst->popup_locked=1;
|
||||
}
|
||||
if ((ev->button == 3) && (!cfg->menu))
|
||||
else if ((ev->button == 3) && (!cfg->menu))
|
||||
{
|
||||
E_Menu *mn;
|
||||
E_Menu_Item *mi;
|
||||
|
@ -125,7 +125,7 @@ _cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event)
|
|||
}
|
||||
|
||||
EAPI void
|
||||
_cb_mouse_in(void *data, Evas *evas, Evas_Object *obj, void *event)
|
||||
_cb_mouse_in(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||
{
|
||||
Instance *inst;
|
||||
Config_Item *ci;
|
||||
|
@ -139,7 +139,7 @@ _cb_mouse_in(void *data, Evas *evas, Evas_Object *obj, void *event)
|
|||
char buf[PATH_MAX];
|
||||
|
||||
inst = data;
|
||||
if (inst->popup) return;
|
||||
if (inst->popup != NULL) return;
|
||||
|
||||
inst->popup = E_NEW(Popup, 1);
|
||||
ci = _config_item_get(inst->gcc->id);
|
||||
|
@ -250,7 +250,7 @@ _cb_mouse_in(void *data, Evas *evas, Evas_Object *obj, void *event)
|
|||
}
|
||||
|
||||
EAPI void
|
||||
_cb_mouse_out(void *data, Evas *evas, Evas_Object *obj, void *event)
|
||||
_cb_mouse_out(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||
{
|
||||
Instance *inst;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
EAPI int _cb_poll(void *data);
|
||||
EAPI void _cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event);
|
||||
EAPI void _cb_mouse_in(void *data, Evas *evas, Evas_Object *obj, void *event);
|
||||
EAPI void _cb_mouse_out(void *data, Evas *evas, Evas_Object *obj, void *event);
|
||||
EAPI void _cb_mouse_in(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
EAPI void _cb_mouse_out(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue