Including icon show/hide in bubble widget

States and program craeted to allow that the user can change/delete
an icon without the icon remain floating on the screen

By: Fabiano Fidencio <fidencio@profusion.mobi>



SVN revision: 49703
This commit is contained in:
Iván Briano 2010-06-16 20:57:42 +00:00
parent 760c3c076d
commit 3b77b92e53
2 changed files with 93 additions and 2 deletions

View File

@ -6364,6 +6364,7 @@ collections {
type: SWALLOW;
description { state: "default" 0.0;
fixed: 1 1;
visible: 0;
align: 0.0 0.0;
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
@ -6377,6 +6378,10 @@ collections {
offset: 4 -1;
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "elm.text";
type: TEXT;
@ -6479,6 +6484,22 @@ collections {
}
}
}
programs {
program {
name: "icon_show";
signal: "elm,state,icon,visible";
source: "elm";
action: STATE_SET "visible" 0.0;
target: "elm.swallow.icon";
}
program {
name: "icon_hide";
signal: "elm,state,icon,hidden";
source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.icon";
}
}
}
group { name: "elm/bubble/top_right/default";
@ -6491,6 +6512,7 @@ collections {
type: SWALLOW;
description { state: "default" 0.0;
fixed: 1 1;
visible: 0;
align: 1.0 0.0;
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
@ -6504,6 +6526,10 @@ collections {
offset: -5 -1;
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "elm.text";
type: TEXT;
@ -6606,6 +6632,22 @@ collections {
}
}
}
programs {
program {
name: "icon_show";
signal: "elm,state,icon,visible";
source: "elm";
action: STATE_SET "visible" 0.0;
target: "elm.swallow.icon";
}
program {
name: "icon_hide";
signal: "elm,state,icon,hidden";
source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.icon";
}
}
}
group { name: "elm/bubble/bottom_left/default";
@ -6618,6 +6660,7 @@ collections {
type: SWALLOW;
description { state: "default" 0.0;
fixed: 1 1;
visible: 0;
align: 0.0 1.0;
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
@ -6631,6 +6674,10 @@ collections {
offset: 4 -5;
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "elm.text";
type: TEXT;
@ -6733,6 +6780,22 @@ collections {
}
}
}
programs {
program {
name: "icon_show";
signal: "elm,state,icon,visible";
source: "elm";
action: STATE_SET "visible" 0.0;
target: "elm.swallow.icon";
}
program {
name: "icon_hide";
signal: "elm,state,icon,hidden";
source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.icon";
}
}
}
group { name: "elm/bubble/bottom_right/default";
@ -6745,6 +6808,7 @@ collections {
type: SWALLOW;
description { state: "default" 0.0;
fixed: 1 1;
visible: 0.0;
align: 1.0 1.0;
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
@ -6758,6 +6822,10 @@ collections {
offset: -5 -5;
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "elm.text";
type: TEXT;
@ -6860,6 +6928,22 @@ collections {
}
}
}
programs {
program {
name: "icon_show";
signal: "elm,state,icon,visible";
source: "elm";
action: STATE_SET "visible" 0.0;
target: "elm.swallow.icon";
}
program {
name: "icon_hide";
signal: "elm,state,icon,hidden";
source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.icon";
}
}
}
///////////////////////////////////////////////////////////////////////////////

View File

@ -74,7 +74,12 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
if (sub == wd->content) wd->content = NULL;
else if (sub == wd->icon) wd->icon = NULL;
else if (sub == wd->icon)
{
edje_object_signal_emit(wd->bbl, "elm,state,icon,hidden", "elm");
wd->icon = NULL;
edje_object_message_signal_process(wd->bbl);
}
_sizing_eval(obj);
}
@ -260,8 +265,10 @@ elm_bubble_icon_set(Evas_Object *obj, Evas_Object *icon)
edje_object_part_swallow(wd->bbl, "elm.swallow.icon", icon);
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
edje_object_signal_emit(wd->bbl, "elm,state,icon,visible", "elm");
edje_object_message_signal_process(wd->bbl);
_sizing_eval(obj);
}
_sizing_eval(obj);
}
/**