forked from enlightenment/efl
button: Add support for efl_text_set
For now a very quick and dirty solution, relying on elm_layout legacy APIs.
This commit is contained in:
parent
1ce8c1c3d1
commit
b5b78c0232
|
@ -445,6 +445,8 @@ _elm_button_class_constructor(Efl_Class *klass)
|
|||
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
||||
}
|
||||
|
||||
EFL_TEXT_DEFAULT_IMPLEMENT(elm_button, Elm_Button_Data)
|
||||
|
||||
/* Efl.Part begin */
|
||||
|
||||
ELM_PART_OVERRIDE(elm_button, ELM_BUTTON, ELM_LAYOUT, Elm_Button_Data, Elm_Part_Data)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm.Button (Elm.Layout, Efl.Ui.Clickable,
|
||||
class Elm.Button (Elm.Layout, Efl.Ui.Clickable, Efl.Text,
|
||||
Elm.Interface.Atspi_Widget_Action)
|
||||
{
|
||||
[[Push-button widget
|
||||
|
@ -87,5 +87,6 @@ class Elm.Button (Elm.Layout, Efl.Ui.Clickable,
|
|||
Elm.Layout.sizing_eval;
|
||||
Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
|
||||
Efl.Part.part;
|
||||
Efl.Text.text { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,4 +125,17 @@ _ ## type ## _internal_part_efl_container_content_unset(Eo *obj, void *_pd EINA_
|
|||
ELM_PART_RETURN_VAL(_ ## type ## _content_unset(pd->obj, sd, pd->part)); \
|
||||
}
|
||||
|
||||
#define EFL_TEXT_DEFAULT_IMPLEMENT(type, Type) \
|
||||
EOLIAN static void \
|
||||
_ ## type ## _efl_text_text_set(Eo *obj, Type *pd EINA_UNUSED, const char *text) \
|
||||
{ \
|
||||
elm_layout_text_set(obj, NULL, text); \
|
||||
} \
|
||||
\
|
||||
EOLIAN static const char * \
|
||||
_ ## type ## _efl_text_text_get(Eo *obj, Elm_Button_Data *pd EINA_UNUSED) \
|
||||
{ \
|
||||
return elm_layout_text_get(obj, NULL); \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue