program {
signal: "elm,state,title,show"; source: "elm";
action: STATE_SET "default" 0.0;
+ target: "top";
+ target: "shadow";
+ target: "elm.swallow.content";
+ target: "buttons_clip";
+ }
+ program {
+ signal: "elm,action,title,show"; source: "elm";
+ action: STATE_SET "default" 0.0;
transition: DECELERATE 0.5;
target: "top";
target: "shadow";
program { name: "titleshow2";
action: STATE_SET "default" 0.0;
target: "buttons_clip";
+ after: "title_transition_finished";
}
program {
signal: "elm,state,title,hide"; source: "elm";
action: STATE_SET "title-hidden" 0.0;
target: "buttons_clip";
+ target: "top";
+ target: "shadow";
+ target: "elm.swallow.content";
+ }
+ program {
+ signal: "elm,action,title,hide"; source: "elm";
+ action: STATE_SET "title-hidden" 0.0;
+ target: "buttons_clip";
after: "titlehide2";
}
program { name: "titlehide2";
target: "top";
target: "shadow";
target: "elm.swallow.content";
+ after: "title_transition_finished";
+ }
+ program { name: "title_transition_finished";
+ action: SIGNAL_EMIT "elm,action,title,transition,finished" "elm";
}
program {
signal: "elm,state,prev_btn,show"; source: "elm";
void
_title_visible(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- elm_naviframe_item_title_visible_set(data,
- !elm_naviframe_item_title_visible_get(data));
+ elm_naviframe_item_title_enabled_set(data,
+ !elm_naviframe_item_title_enabled_get(data),
+ EINA_TRUE);
}
void
elm_image_file_set(ic, buf, NULL);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_object_item_part_content_set(it, "icon", ic);
- elm_naviframe_item_title_visible_set(it, EINA_FALSE);
+ elm_naviframe_item_title_enabled_set(it, EINA_FALSE, EINA_FALSE);
evas_object_smart_callback_add(content, "clicked", _title_visible, it);
}
static void
_title_visible(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- elm_naviframe_item_title_visible_set(data,
- !elm_naviframe_item_title_visible_get(data));
+ elm_naviframe_item_title_enabled_set(data,
+ !elm_naviframe_item_title_enabled_get(data),
+ EINA_TRUE);
}
static void
elm_image_file_set(ic, buf, NULL);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_object_item_part_content_set(it, "icon", ic);
- elm_naviframe_item_title_visible_set(it, EINA_FALSE);
+ elm_naviframe_item_title_enabled_set(it, EINA_FALSE, EINA_FALSE);
evas_object_smart_callback_add(content, "clicked", _title_visible, it);
}
static const char TITLE_ACCESS_PART[] = "access.title";
static const char SIG_TRANSITION_FINISHED[] = "transition,finished";
+static const char SIG_TITLE_TRANSITION_FINISHED[] = "title,transition,finished";
static const char SIG_TITLE_CLICKED[] = "title,clicked";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_TRANSITION_FINISHED, ""},
+ {SIG_TITLE_TRANSITION_FINISHED, ""},
{SIG_TITLE_CLICKED, ""},
{"focused", ""}, /**< handled by elm_widget */
{"unfocused", ""}, /**< handled by elm_widget */
}
static void
-_item_title_visible_update(Elm_Naviframe_Item *nit)
+_on_item_title_transition_finished(void *data,
+ Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
{
- if (nit->title_visible)
- elm_object_signal_emit(VIEW(nit), "elm,state,title,show", "elm");
+ Elm_Naviframe_Item *it = data;
+
+ evas_object_smart_callback_call(WIDGET(it), SIG_TITLE_TRANSITION_FINISHED, data);
+}
+
+static void
+_item_title_enabled_update(Elm_Naviframe_Item *nit, Eina_Bool transition)
+{
+ transition = !!transition;
+ if (transition)
+ {
+ if (nit->title_enabled)
+ elm_object_signal_emit(VIEW(nit), "elm,action,title,show", "elm");
+ else
+ elm_object_signal_emit(VIEW(nit), "elm,action,title,hide", "elm");
+ }
else
- elm_object_signal_emit(VIEW(nit), "elm,state,title,hide", "elm");
+ {
+ if (nit->title_enabled)
+ elm_object_signal_emit(VIEW(nit), "elm,state,title,show", "elm");
+ else
+ elm_object_signal_emit(VIEW(nit), "elm,state,title,hide", "elm");
+ }
}
static void
if ((style && sstyle) && strcmp(style, sstyle))
_item_style_set(it, it->style);
_item_signals_emit(it);
- _item_title_visible_update(it);
+ _item_title_enabled_update(it, EINA_FALSE);
}
elm_layout_sizing_eval(obj);
char *ret;
nit = data;
- if (!nit->title_visible) return NULL;
+ if (!nit->title_enabled) return NULL;
layout = VIEW(nit);
info = elm_object_part_text_get(layout, TITLE_PART);
(VIEW(it), "elm,action,pushed,finished", "*", _on_item_push_finished, it);
elm_object_signal_callback_add
(VIEW(it), "elm,action,popped,finished", "*", _on_item_pop_finished, it);
+ elm_object_signal_callback_add
+ (VIEW(it), "elm,action,title,transition,finished", "*", _on_item_title_transition_finished, it);
elm_object_signal_callback_add
(VIEW(it), "elm,action,title,clicked", "*", _on_item_title_clicked, it);
_item_content_set(it, content);
_item_dispmode_set(it, sd->dispmode);
- it->title_visible = EINA_TRUE;
+ it->title_enabled = EINA_TRUE;
return it;
}
_item_style_set(nit, item_style);
_item_signals_emit(nit);
- _item_title_visible_update(nit);
+ _item_title_enabled_update(nit, EINA_FALSE);
}
EAPI const char *
return nit->style;
}
-EAPI void
+EINA_DEPRECATED EAPI void
elm_naviframe_item_title_visible_set(Elm_Object_Item *it,
Eina_Bool visible)
+{
+ elm_naviframe_item_title_enabled_set(it, visible, EINA_FALSE);
+}
+
+EINA_DEPRECATED EAPI Eina_Bool
+elm_naviframe_item_title_visible_get(const Elm_Object_Item *it)
+{
+ return elm_naviframe_item_title_enabled_get(it);
+}
+
+EAPI void
+elm_naviframe_item_title_enabled_set(Elm_Object_Item *it,
+ Eina_Bool enabled,
+ Eina_Bool transition)
{
Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it;
ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it);
- visible = !!visible;
- if (nit->title_visible == visible) return;
+ enabled = !!enabled;
+ if (nit->title_enabled == enabled) return;
+
+ nit->title_enabled = enabled;
- nit->title_visible = visible;
- _item_title_visible_update(nit);
+ transition = !!transition;
+ _item_title_enabled_update(nit, transition);
}
EAPI Eina_Bool
-elm_naviframe_item_title_visible_get(const Elm_Object_Item *it)
+elm_naviframe_item_title_enabled_get(const Elm_Object_Item *it)
{
Elm_Naviframe_Item *nit = (Elm_Naviframe_Item *)it;
ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
- return nit->title_visible;
+ return nit->title_enabled;
}
EAPI void
* @ref Layout:
* @li @c "transition,finished" - When the transition is finished in
* changing the item
+ * @li @c "title,transition,finished" - When the title area's transition
+ * is finished in changing the state
+ * of the title
* @li @c "title,clicked" - User clicked title area
* @li @c "focused" - When the naviframe has received focus. (since 1.8)
* @li @c "unfocused" - When the naviframe has lost focus. (since 1.8)
EAPI const char *elm_naviframe_item_style_get(const Elm_Object_Item *it);
/**
- * @brief Show/Hide the title area
+ * @brief Enable/Disable the title area with transition effect
*
* @param it The naviframe item
- * @param visible If @c EINA_TRUE, title area will be visible, hidden
+ * @param enabled If @c EINA_TRUE, title area will be enabled, disabled
* otherwise
+ * @param transition If @c EINA_TRUE, transition effect of the title will be
+ * visible, invisible otherwise
*
- * When the title area is invisible, then the controls would be hidden so as * to expand the content area to full-size.
+ * When the title area is disabled, then the controls would be hidden so as
+ * to expand the content area to full-size.
*
- * @see also elm_naviframe_item_title_visible_get()
+ * @see also elm_naviframe_item_title_enabled_get()
+ * @see also elm_naviframe_item_title_visible_set()
*
* @ingroup Naviframe
*/
-EAPI void elm_naviframe_item_title_visible_set(Elm_Object_Item *it, Eina_Bool visible);
+EAPI void elm_naviframe_item_title_enabled_set(Elm_Object_Item *it, Eina_Bool enabled, Eina_Bool transition);
/**
- * @brief Get a value whether title area is visible or not.
+ * @brief Get a value whether title area is enabled or not.
*
* @param it The naviframe item
- * @return If @c EINA_TRUE, title area is visible
+ * @return If @c EINA_TRUE, title area is enabled
*
- * @see also elm_naviframe_item_title_visible_set()
+ * @see also elm_naviframe_item_title_enabled_set()
*
* @ingroup Naviframe
*/
-EAPI Eina_Bool elm_naviframe_item_title_visible_get(const Elm_Object_Item *it);
+EAPI Eina_Bool elm_naviframe_item_title_enabled_get(const Elm_Object_Item *it);
/**
* @brief Set a function to be called when @c it of the naviframe is going to be
{
Elm_Object_Item *it;
it = elm_naviframe_item_push(obj, NULL, NULL, NULL, content, NULL);
- elm_naviframe_item_title_visible_set(it, EINA_FALSE);
+ elm_naviframe_item_title_enabled_set(it, EINA_FALSE, EINA_FALSE);
return it;
}
*/
EINA_DEPRECATED EAPI const char *elm_object_translatable_text_part_get(const Evas_Object *obj, const char *part);
+/**
+ * @brief Show/Hide the title area
+ *
+ * @param it The naviframe item
+ * @param visible If @c EINA_TRUE, title area will be visible, hidden
+ * otherwise
+ *
+ * When the title area is invisible, then the controls would be hidden so as
+ * to expand the content area to full-size.
+ *
+ * @deprecated Use elm_naviframe_item_title_enabled_set() instead.
+ *
+ * @see also elm_naviframe_item_title_visible_get()
+ * @see also elm_naviframe_item_title_enabled_get()
+ *
+ * @ingroup Naviframe
+ */
+EINA_DEPRECATED EAPI void elm_naviframe_item_title_visible_set(Elm_Object_Item *it, Eina_Bool visible);
+
+/**
+ * @brief Get a value whether title area is visible or not.
+ *
+ * @param it The naviframe item
+ * @return If @c EINA_TRUE, title area is visible
+ *
+ * @deprecated Use elm_naviframe_item_title_enabled_get() instead.
+ *
+ * @see also elm_naviframe_item_title_visible_set()
+ *
+ * @ingroup Naviframe
+ */
+EINA_DEPRECATED EAPI Eina_Bool elm_naviframe_item_title_visible_get(const Elm_Object_Item *it);
+
/**
* Enable/disable horizontal and vertical bouncing effect.
*
Evas_Coord minw;
Evas_Coord minh;
- Eina_Bool title_visible : 1;
+ Eina_Bool title_enabled : 1;
Eina_Bool unfocusable : 1;
Eina_Bool popping : 1;
};