fix some dynamic object deletion for sub-objects. fix some theme stuff too

for popout hover.



SVN revision: 37818
This commit is contained in:
Carsten Haitzler 2008-11-27 05:41:13 +00:00
parent 774879b514
commit 793b34f2f9
5 changed files with 74 additions and 12 deletions

View File

@ -2399,6 +2399,7 @@ collections {
} }
part { name: "elm.swallow.slot.left"; part { name: "elm.swallow.slot.left";
type: SWALLOW; type: SWALLOW;
clip_to: "leftclip";
description { state: "default" 0.0; description { state: "default" 0.0;
align: 0.0 0.5; align: 0.0 0.5;
rel1.to: "elm.swallow.slot.middle"; rel1.to: "elm.swallow.slot.middle";
@ -2456,6 +2457,7 @@ collections {
} }
part { name: "elm.swallow.slot.right"; part { name: "elm.swallow.slot.right";
type: SWALLOW; type: SWALLOW;
clip_to: "rightclip";
description { state: "default" 0.0; description { state: "default" 0.0;
align: 1.0 0.5; align: 1.0 0.5;
rel1.to: "elm.swallow.slot.middle"; rel1.to: "elm.swallow.slot.middle";
@ -2572,6 +2574,7 @@ collections {
} }
part { name: "elm.swallow.slot.bottom"; part { name: "elm.swallow.slot.bottom";
type: SWALLOW; type: SWALLOW;
clip_to: "bottomclip";
description { state: "default" 0.0; description { state: "default" 0.0;
align: 0.5 1.0; align: 0.5 1.0;
rel1.to: "elm.swallow.slot.middle"; rel1.to: "elm.swallow.slot.middle";

View File

@ -192,11 +192,19 @@ extern "C" {
/* smart callbacks called: /* smart callbacks called:
*/ */
typedef enum _Elm_Hover_Axis
{
ELM_HOVER_AXIS_NONE,
ELM_HOVER_AXIS_HORIZONTAL,
ELM_HOVER_AXIS_VERTICAL,
ELM_HOVER_AXIS_BOTH
} Elm_Hover_Axis;
EAPI Evas_Object *elm_hover_add(Evas_Object *parent); EAPI Evas_Object *elm_hover_add(Evas_Object *parent);
EAPI void elm_hover_target_set(Evas_Object *obj, Evas_Object *target); EAPI void elm_hover_target_set(Evas_Object *obj, Evas_Object *target);
EAPI void elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent); EAPI void elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
EAPI void elm_hover_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content); EAPI void elm_hover_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content);
EAPI void elm_hover_style_set(Evas_Object *obj, const char *style); EAPI void elm_hover_style_set(Evas_Object *obj, const char *style);
EAPI const char *elm_hover_best_content_location_get(Evas_Object *obj, Elm_Hover_Axis pref_axis);
/* smart callbacks called: /* smart callbacks called:
* "clicked" - the user clicked the empty space in the hover to dismiss * "clicked" - the user clicked the empty space in the hover to dismiss
*/ */
@ -309,24 +317,26 @@ extern "C" {
// * left/right arrow broken with password mode for entry + utf8 chars... // * left/right arrow broken with password mode for entry + utf8 chars...
// //
//// (incomplete - medium priority) //// (incomplete - medium priority)
// * bubble should allow style (left/right + top/bottom)
// * hover needs a "best direction" call for where to put entries with constraints
// * buttons need a "bigbutton" option
// * disabled not supported // * disabled not supported
// * tab widget focusing (not useful for touchscreen tho...) // * tab widget focusing (not useful for touchscreen tho...)
// * bubble should allow style (left/right + top/bottom)
// * on the fly theme changes - test (should work) // * on the fly theme changes - test (should work)
// * entry selection conflicts with finger scroll (make selection start/stop work on signals?) // * entry selection conflicts with finger scroll (make selection start/stop work on signals?)
// * need a hold-scroll counter in elm_widget // * need a hold-scroll counter in elm_widget
// * add fullscreen mode on/off for windows // * add fullscreen mode on/off for windows
// //
//// (more widgets/features - medium priority) //// (more widgets/features - medium priority)
// * need multi-sel (with button + hover + ...)
// * need "photoframe" widget (for contact photos?)
// * toolbar widget (edje + box + button + separators) // * toolbar widget (edje + box + button + separators)
// * listitem widget (simple label + icon) // * listitem widget (simple label + icon)
// * radio widget + group handling // * radio widget + group handling
// * checkbox widget (like toggle) // * checkbox widget (like toggle)
// * need separator widget (h/v) // * need separator widget (h/v)
// * need slide-open "panel" that can hold stuff and optionally scroll // * need slide-open "panel" that can hold stuff and optionally scroll
// * need "photoframe" widget (for contact photos?)
// * need calendar widget (select date) // * need calendar widget (select date)
// * need multi-sel (with button + hover + ...)
// * need slider widget // * need slider widget
// * need range selector (select range of values from X to Y over an interval) // * need range selector (select range of values from X to Y over an interval)
// * need "dialogbutton" widget (bigger button for bottom of wins) // * need "dialogbutton" widget (bigger button for bottom of wins)

View File

@ -110,6 +110,7 @@ _on_focus_hook(void *data, Evas_Object *obj)
{ {
Widget_Data *wd = elm_widget_data_get(obj); Widget_Data *wd = elm_widget_data_get(obj);
Evas_Object *top = elm_widget_top_get(obj); Evas_Object *top = elm_widget_top_get(obj);
if (!wd->editable) return;
if (elm_widget_focus_get(obj)) if (elm_widget_focus_get(obj))
{ {
evas_object_focus_set(wd->ent, 1); evas_object_focus_set(wd->ent, 1);

View File

@ -217,8 +217,8 @@ static void
_signal_dismiss(void *data, Evas_Object *obj, const char *emission, const char *source) _signal_dismiss(void *data, Evas_Object *obj, const char *emission, const char *source)
{ {
Widget_Data *wd = elm_widget_data_get(data); Widget_Data *wd = elm_widget_data_get(data);
evas_object_smart_callback_call(data, "clicked", NULL);
evas_object_hide(data); evas_object_hide(data);
evas_object_smart_callback_call(data, "clicked", NULL);
} }
static void static void
@ -388,3 +388,41 @@ elm_hover_style_set(Evas_Object *obj, const char *style)
_reval_content(obj); _reval_content(obj);
_sizing_eval(obj); _sizing_eval(obj);
} }
EAPI const char *
elm_hover_best_content_location_get(Evas_Object *obj, Elm_Hover_Axis pref_axis)
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord x = 0, y = 0, w = 0, h = 0, x2 = 0, y2 = 0, w2 = 0, h2 = 0;
Evas_Coord spc_l, spc_r, spc_t, spc_b;
if (wd->parent) evas_object_geometry_get(wd->parent, &x, &y, &w, &h);
if (wd->hov) evas_object_geometry_get(wd->hov, &x2, &y2, &w2, &h2);
spc_l = x2 - x;
spc_r = (x + w) - (x2 + w2);
if (spc_l < 0) spc_l = 0;
if (spc_r < 0) spc_r = 0;
spc_t = y2 - y;
spc_b = (y + h) - (y2 + y2);
if (spc_t < 0) spc_t = 0;
if (spc_b < 0) spc_b = 0;
if (pref_axis == ELM_HOVER_AXIS_HORIZONTAL)
{
if (spc_l < spc_r) return "right";
else return "left";
}
else if (pref_axis == ELM_HOVER_AXIS_VERTICAL)
{
if (spc_t < spc_b) return "bottom";
else return "top";
}
if (spc_l < spc_r)
{
if (spc_t > spc_r) return "top";
else if (spc_b > spc_r) return "bottom";
return "right";
}
if (spc_t > spc_r) return "top";
else if (spc_b > spc_r) return "bottom";
return "left";
}

View File

@ -55,9 +55,17 @@ static void
_sub_obj_del(void *data, Evas *e, Evas_Object *obj, void *event_info) _sub_obj_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
{ {
Smart_Data *sd = data; Smart_Data *sd = data;
if (obj == sd->resize_obj) sd->resize_obj = NULL; if (obj == sd->resize_obj)
{
sd->resize_obj = NULL;
evas_object_smart_callback_call(sd->obj, "sub-object-del", obj);
}
else if (obj == sd->hover_obj) sd->hover_obj = NULL; else if (obj == sd->hover_obj) sd->hover_obj = NULL;
else sd->subobjs = eina_list_remove(sd->subobjs, obj); else
{
sd->subobjs = eina_list_remove(sd->subobjs, obj);
evas_object_smart_callback_call(sd->obj, "sub-object-del", obj);
}
} }
static void static void
@ -180,13 +188,14 @@ elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj)
} }
if (!strcmp(evas_object_type_get(sobj), SMART_NAME)) if (!strcmp(evas_object_type_get(sobj), SMART_NAME))
{ {
sd = evas_object_smart_data_get(sobj); Smart_Data *sd2 = evas_object_smart_data_get(sobj);
if (sd) if (sd2)
{ {
if (sd->parent_obj) elm_widget_sub_object_del(sd->parent_obj, sobj); if (sd2->parent_obj) elm_widget_sub_object_del(sd2->parent_obj, sobj);
sd->parent_obj = obj; sd2->parent_obj = obj;
} }
} }
evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
evas_object_smart_callback_call(obj, "sub-object-add", sobj); evas_object_smart_callback_call(obj, "sub-object-add", sobj);
} }
@ -201,9 +210,10 @@ elm_widget_sub_object_del(Evas_Object *obj, Evas_Object *sobj)
} }
if (!strcmp(evas_object_type_get(sobj), SMART_NAME)) if (!strcmp(evas_object_type_get(sobj), SMART_NAME))
{ {
sd = evas_object_smart_data_get(sobj); Smart_Data *sd2 = evas_object_smart_data_get(sobj);
if (sd) sd->parent_obj = NULL; if (sd2) sd->parent_obj = NULL;
} }
evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del);
evas_object_smart_callback_call(obj, "sub-object-del", sobj); evas_object_smart_callback_call(obj, "sub-object-del", sobj);
} }