Evas_Coord minh;
Eina_Bool back_btn: 1;
Eina_Bool title_visible: 1;
+ Eina_Bool content_unfocusable : 1;
};
static const char *widtype = NULL;
static const char SIG_TRANSITION_FINISHED[] = "transition,finished";
static const char SIG_TITLE_CLICKED[] = "title,clicked";
-//widget item signals
-static const char SIG_ITEM_SHOW_BEGIN[] = "show,begin";
-static const char SIG_ITEM_HIDE_FINISHED[] = "hide,finished";
-
static const Evas_Smart_Cb_Description _signals[] = {
{SIG_TRANSITION_FINISHED, ""},
{SIG_TITLE_CLICKED, ""},
- {SIG_ITEM_SHOW_BEGIN, ""},
- {SIG_ITEM_HIDE_FINISHED, ""},
{NULL, NULL}
};
{
Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
if (!it) return;
- return elm_object_item_signal_emit(it, emission, source);
+ elm_object_item_signal_emit(it, emission, source);
}
static void
if (!part || !strcmp(part, "default"))
snprintf(buf, sizeof(buf), "elm.text.title");
- else if(!strcmp("subtitle", part))
+ else if (!strcmp("subtitle", part))
snprintf(buf, sizeof(buf), "elm.text.subtitle");
else
snprintf(buf, sizeof(buf), "%s", part);
if (label)
{
- snprintf(buf, sizeof(buf), "elm,state,%s,show", buf);
+ snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
elm_object_signal_emit(VIEW(navi_it), buf, "elm");
}
else
{
- snprintf(buf, sizeof(buf), "elm,state,%s,hide", buf);
+ snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
elm_object_signal_emit(VIEW(navi_it), buf, "elm");
}
if (!part || !strcmp(part, "default"))
snprintf(buf, sizeof(buf), "elm.text.title");
- else if(!strcmp("subtitle", part))
+ else if (!strcmp("subtitle", part))
snprintf(buf, sizeof(buf), "elm.text.subtitle");
else
snprintf(buf, sizeof(buf), "%s", part);
}
eina_stringshare_del(it->style);
+
+ if (wd->preserve && it->content)
+ {
+ elm_object_part_content_unset(VIEW(it), "elm.swallow.content");
+ evas_object_event_callback_del(it->content,
+ EVAS_CALLBACK_DEL,
+ _item_content_del);
+ }
}
static Eina_Bool
if (!wd) return;
evas_object_hide(VIEW(it));
+
+ if (it->content)
+ elm_widget_tree_unfocusable_set(it->content, it->content_unfocusable);
+
if (wd->freeze_events)
evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
-
- elm_widget_item_smart_callback_call(it,
- SIG_ITEM_HIDE_FINISHED,
- NULL);
}
static void
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
+ Widget_Data *wd;
Elm_Naviframe_Item *it = data;
if (!it) return;
+
+ wd = elm_widget_data_get(WIDGET(it));
+ if (!wd) return;
+
+ if (wd->preserve && it->content)
+ elm_widget_tree_unfocusable_set(it->content, it->content_unfocusable);
+
_item_del(data);
+
elm_widget_item_free(data);
}
wd = elm_widget_data_get(WIDGET(it));
if (!wd) return;
+ elm_widget_tree_unfocusable_set(it->content, it->content_unfocusable);
+
evas_object_smart_callback_call(WIDGET(it),
SIG_TRANSITION_FINISHED,
data);
if (navi_it->title_next_btn)
elm_object_signal_emit(VIEW(navi_it), "elm,state,next_btn,show", "elm");
-// why does this forcibly enable title? isnt that separate to style?
-// navi_it->title_visible = EINA_TRUE;
_sizing_eval(WIDGET(navi_it));
wd = elm_widget_data_get(WIDGET(navi_it));
//item base layout
VIEW(it) = elm_layout_add(obj);
- evas_object_smart_member_add(VIEW(it), wd->base);
+ evas_object_smart_member_add(VIEW(it), obj);
evas_object_event_callback_add(VIEW(it),
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
static Eina_Bool
_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
{
+ Eina_Bool ret;
+ Elm_Naviframe_Item *top_it;
+ Eina_List *l = NULL;
Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd || !wd->stack) return EINA_FALSE;
- return elm_widget_focus_next_get(VIEW(elm_naviframe_top_item_get(obj)),
- dir,
- next);
+ void *(*list_data_get)(const Eina_List *list);
+ if (!wd) return EINA_FALSE;
+
+ top_it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj);
+ if (!top_it) return EINA_FALSE;
+
+ list_data_get = eina_list_data_get;
+
+ //Forcus order: prev button, next button, contents
+ if (top_it->title_prev_btn)
+ l = eina_list_append(l, top_it->title_prev_btn);
+ if (top_it->title_next_btn)
+ l = eina_list_append(l, top_it->title_next_btn);
+ l = eina_list_append(l, VIEW(top_it));
+
+ ret = elm_widget_focus_list_next_get(obj, l, list_data_get, dir, next);
+ eina_list_free(l);
+ return ret;
}
EAPI Evas_Object *
//base
//FIXME: Is this base layout really needed?
- wd->base = elm_layout_add(parent);
+ wd->base = elm_layout_add(obj);
evas_object_event_callback_add(wd->base,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints,
elm_object_signal_emit(VIEW(prev_it), "elm,state,cur,pushed", "elm");
elm_object_signal_emit(VIEW(it), "elm,state,new,pushed", "elm");
edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
- elm_widget_tree_unfocusable_set(it->content, EINA_TRUE);
+ if (prev_it->content)
+ {
+ prev_it->content_unfocusable = elm_widget_tree_unfocusable_get(prev_it->content);
+ elm_widget_tree_unfocusable_set(prev_it->content, EINA_TRUE);
+ }
edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
}
wd->stack = eina_inlist_append(wd->stack, EINA_INLIST_GET(it));
wd = elm_widget_data_get(obj);
if (!wd) return NULL;
- it = _item_new(WIDGET(before), title_label, prev_btn, next_btn, content,
- item_style);
+ it = _item_new(obj, title_label, prev_btn, next_btn, content, item_style);
if (!it) return NULL;
wd->stack =
eina_inlist_prepend_relative(wd->stack,
EINA_INLIST_GET(it),
EINA_INLIST_GET(((Elm_Naviframe_Item *) before)));
- _sizing_eval(WIDGET(before));
+ _sizing_eval(obj);
return (Elm_Object_Item *)it;
}
ELM_OBJ_ITEM_CHECK_OR_RETURN(after, NULL);
Elm_Naviframe_Item *it;
Widget_Data *wd;
+ Eina_Bool top_inserted;
wd = elm_widget_data_get(obj);
if (!wd) return NULL;
- it = _item_new(WIDGET(after), title_label, prev_btn, next_btn, content,
- item_style);
+ it = _item_new(obj, title_label, prev_btn, next_btn, content, item_style);
if (!it) return NULL;
- if (elm_naviframe_top_item_get(WIDGET(after)) == after)
- {
- evas_object_hide(VIEW(after));
- evas_object_show(VIEW(it));
- }
+ if (elm_naviframe_top_item_get(obj) == after) top_inserted = EINA_TRUE;
+
wd->stack =
eina_inlist_append_relative(wd->stack,
EINA_INLIST_GET(it),
EINA_INLIST_GET(((Elm_Naviframe_Item *) after)));
- _sizing_eval(WIDGET(after));
+ if (top_inserted)
+ {
+ evas_object_show(VIEW(it));
+ evas_object_hide(VIEW(after));
+ }
+
+ _sizing_eval(obj);
+
return (Elm_Object_Item *)it;
}
if (wd->preserve)
content = it->content;
+ if (it->content)
+ {
+ it->content_unfocusable = elm_widget_tree_unfocusable_get(it->content);
+ elm_widget_tree_unfocusable_set(it->content, EINA_TRUE);
+ }
+
if (wd->stack->last->prev)
prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev,
Elm_Naviframe_Item);
}
elm_object_signal_emit(VIEW(it), "elm,state,cur,popped", "elm");
evas_object_show(VIEW(prev_it));
- evas_object_raise(VIEW(prev_it));
elm_object_signal_emit(VIEW(prev_it),
"elm,state,prev,popped",
"elm");
edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
- elm_widget_item_smart_callback_call(prev_it,
- SIG_ITEM_SHOW_BEGIN,
- NULL);
}
else
{
l = wd->stack->last->prev;
- while(l)
+ while (l)
{
if (EINA_INLIST_CONTAINER_GET(l, Elm_Naviframe_Item) ==
((Elm_Naviframe_Item *)it)) break;
if (!wd) return;
if (it == elm_naviframe_top_item_get(navi_it->base.widget)) return;
- elm_widget_tree_unfocusable_set(navi_it->content, EINA_FALSE);
wd->stack = eina_inlist_demote(wd->stack, EINA_INLIST_GET(navi_it));
prev_it = EINA_INLIST_CONTAINER_GET(wd->stack->last->prev,
Elm_Naviframe_Item);
- elm_widget_tree_unfocusable_set(prev_it->content, EINA_FALSE);
+ if (prev_it->content)
+ {
+ prev_it->content_unfocusable = elm_widget_tree_unfocusable_get(prev_it->content);
+ elm_widget_tree_unfocusable_set(prev_it->content, EINA_TRUE);
+ }
+
if (wd->freeze_events)
{
evas_object_freeze_events_set(VIEW(it), EINA_TRUE);
if (!strcmp("basic", navi_it->style)) return;
_item_style_set(navi_it, item_style);
+ _item_title_visible_update(navi_it);
}
EAPI const char *