elementary/naviframe - added two more APIs
elm_naviframe_prev_btn_auto_pushed_set/get SVN revision: 64015
This commit is contained in:
parent
dd8d7380a3
commit
3aa046714d
|
@ -28052,6 +28052,29 @@ extern "C" {
|
|||
*/
|
||||
EAPI Eina_Bool elm_naviframe_item_title_visible_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @brief Set creating prev button automatically or not
|
||||
*
|
||||
* @param obj The naviframe object
|
||||
* @param auto_pushed If @c EINA_TRUE, the previous button(back button) will
|
||||
* be created internally when you pass the @c NULL to the prev_btn
|
||||
* parameter in elm_naviframe_item_push
|
||||
*
|
||||
* @see also elm_naviframe_item_push()
|
||||
*/
|
||||
EAPI void elm_naviframe_prev_btn_auto_pushed_set(Evas_Object *obj, Eina_Bool auto_pushed) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* @brief Get a value whether prev button(back button) will be auto pushed or
|
||||
* not.
|
||||
*
|
||||
* @param obj The naviframe object
|
||||
* @return If @c EINA_TRUE, prev button will be auto pushed.
|
||||
*
|
||||
* @see also elm_naviframe_item_push()
|
||||
* elm_naviframe_prev_btn_auto_pushed_set()
|
||||
*/
|
||||
EAPI Eina_Bool elm_naviframe_prev_btn_auto_pushed_get(const Evas_Object *obj); EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -12,6 +12,7 @@ struct _Widget_Data
|
|||
Evas_Object *base;
|
||||
Evas_Object *rect;
|
||||
Eina_Bool preserve: 1;
|
||||
Eina_Bool auto_pushed: 1;
|
||||
Eina_Bool pass_events: 1;
|
||||
};
|
||||
|
||||
|
@ -764,7 +765,7 @@ elm_naviframe_add(Evas_Object *parent)
|
|||
elm_widget_resize_object_set(obj, wd->base);
|
||||
_elm_theme_object_set(obj, wd->base, "naviframe", "base", "default");
|
||||
|
||||
//rect:
|
||||
//rect
|
||||
wd->rect = evas_object_rectangle_add(e);
|
||||
evas_object_color_set(wd->rect, 0, 0, 0, 0);
|
||||
elm_widget_sub_object_add(obj, wd->rect);
|
||||
|
@ -774,6 +775,7 @@ elm_naviframe_add(Evas_Object *parent)
|
|||
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, obj);
|
||||
evas_object_smart_callbacks_descriptions_set(obj, _signals);
|
||||
|
||||
wd->auto_pushed = EINA_TRUE;
|
||||
wd->pass_events = EINA_TRUE;
|
||||
|
||||
return obj;
|
||||
|
@ -836,7 +838,7 @@ elm_naviframe_item_push(Evas_Object *obj,
|
|||
_item_text_set_hook(ELM_CAST(it), "elm.text.title", title_label);
|
||||
|
||||
//title buttons
|
||||
if ((!prev_btn) && (eina_list_count(wd->stack)))
|
||||
if ((!prev_btn) && wd->auto_pushed && eina_list_count(wd->stack))
|
||||
{
|
||||
prev_btn = _back_btn_new(obj);
|
||||
_title_prev_btn_set(it, prev_btn, EINA_TRUE);
|
||||
|
@ -1080,3 +1082,21 @@ elm_naviframe_item_title_visible_get(const Elm_Object_Item *it)
|
|||
return navi_it->title_visible;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_naviframe_prev_btn_auto_pushed_set(Evas_Object *obj, Eina_Bool auto_pushed)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return NULL;
|
||||
wd->auto_pushed = !!auto_pushed;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_naviframe_prev_btn_auto_pushed_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return NULL;
|
||||
return wd->auto_pushed;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue