elm_win: Add back title_set as text.set

Title and name are two different things.
See 466d9fbaf1.
This commit is contained in:
Jean-Philippe Andre 2016-06-07 17:43:45 +09:00
parent a428e1e712
commit 6581885128
2 changed files with 23 additions and 15 deletions

View File

@ -4172,6 +4172,24 @@ _elm_win_eo_base_constructor(Eo *obj, Elm_Win_Data *_pd EINA_UNUSED)
return obj;
}
EOLIAN static void
_elm_win_efl_text_text_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *title)
{
if (!title) return;
eina_stringshare_replace(&(sd->title), title);
if (sd->ee)
TRAP(sd, title_set, sd->title);
if (sd->frame_obj)
edje_object_part_text_escaped_set
(sd->frame_obj, "elm.text.title", sd->title);
}
EOLIAN static const char*
_elm_win_efl_text_text_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
{
return sd->title;
}
EOLIAN static void
_elm_win_type_set(Eo *obj, Elm_Win_Data *sd, Elm_Win_Type type)
{
@ -6185,25 +6203,13 @@ elm_win_shaped_get(const Evas_Object *obj)
EAPI void
elm_win_title_set(Evas_Object *obj, const char *title)
{
ELM_WIN_CHECK(obj);
ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
if (!title) return;
eina_stringshare_replace(&(sd->title), title);
if (sd->ee)
TRAP(sd, title_set, sd->title);
if (sd->frame_obj)
edje_object_part_text_escaped_set
(sd->frame_obj, "elm.text.title", sd->title);
efl_text_set(obj, title);
}
EAPI const char*
elm_win_title_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) NULL;
ELM_WIN_DATA_GET_OR_RETURN(obj, sd, NULL);
return sd->title;
return efl_text_get(obj);
}
EAPI void

View File

@ -149,7 +149,7 @@ enum Elm.Win.Urgent_Mode
class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
Elm.Interface.Atspi_Widget_Action, Efl.Pack,
Efl.Input.State, Efl.Input.Interface, Efl.Screen,
Efl.Gfx.Size.Hint)
Efl.Gfx.Size.Hint, Efl.Text)
{
legacy_prefix: elm_win;
eo_prefix: elm_obj_win;
@ -802,6 +802,8 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
Efl.Gfx.Size.Hint.base.get;
Efl.Gfx.Size.Hint.step.set;
Efl.Gfx.Size.Hint.step.get;
Efl.Text.text.set;
Efl.Text.text.get;
}
constructors {
.name;