forked from enlightenment/efl
efl_ui/alert_popup: use normal C-based part aliasing and remove theme alias
Summary: part aliasing should be done at the layout level, not using bespoke string comparisons. also this removes the "title" part of the alert_popup theme which was previously considered api Depends on D10091 Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10092
This commit is contained in:
parent
1511430c29
commit
d13bd5fa8e
|
@ -32,7 +32,6 @@ group { "efl/popup";
|
||||||
group { "efl/alert_popup"; data.item: "version" "123";
|
group { "efl/alert_popup"; data.item: "version" "123";
|
||||||
images.image: "rounded_square.png" COMP;
|
images.image: "rounded_square.png" COMP;
|
||||||
parts {
|
parts {
|
||||||
alias: "title" "efl.text.title";
|
|
||||||
image { "bg";
|
image { "bg";
|
||||||
desc { "default";
|
desc { "default";
|
||||||
min: 100 100;
|
min: 100 100;
|
||||||
|
|
|
@ -25,15 +25,24 @@ static const char BUTTON_SWALLOW_NAME[EFL_UI_ALERT_POPUP_BUTTON_COUNT][20] =
|
||||||
"efl.button2",
|
"efl.button2",
|
||||||
"efl.button3"};
|
"efl.button3"};
|
||||||
|
|
||||||
|
static const Elm_Layout_Part_Alias_Description _text_aliases[] =
|
||||||
|
{
|
||||||
|
{"title", "efl.text.title"},
|
||||||
|
{NULL, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_efl_ui_alert_popup_text_set(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, const char *part, const char *label)
|
_efl_ui_alert_popup_text_set(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, const char *part, const char *label)
|
||||||
{
|
{
|
||||||
if (eina_streq(part, "title") || eina_streq(part, "efl.text.title"))
|
if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE))
|
||||||
|
return EINA_FALSE;
|
||||||
|
efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
|
||||||
|
if (eina_streq(part, "efl.text.title"))
|
||||||
{
|
{
|
||||||
Eina_Bool changed = eina_stringshare_replace(&pd->title_text, label);
|
Eina_Bool changed = eina_stringshare_replace(&pd->title_text, label);
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
efl_text_set(efl_part(efl_super(obj, MY_CLASS), "title"), label);
|
efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
|
||||||
if (label)
|
if (label)
|
||||||
elm_layout_signal_emit(obj, "efl,title,show", "efl");
|
elm_layout_signal_emit(obj, "efl,title,show", "efl");
|
||||||
else
|
else
|
||||||
|
@ -44,8 +53,6 @@ _efl_ui_alert_popup_text_set(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, const char *p
|
||||||
efl_canvas_group_change(obj);
|
efl_canvas_group_change(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
|
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +60,9 @@ _efl_ui_alert_popup_text_set(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, const char *p
|
||||||
const char *
|
const char *
|
||||||
_efl_ui_alert_popup_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Alert_Popup_Data *pd, const char *part)
|
_efl_ui_alert_popup_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Alert_Popup_Data *pd, const char *part)
|
||||||
{
|
{
|
||||||
if (eina_streq(part, "title") || eina_streq(part, "efl.text.title"))
|
if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE))
|
||||||
|
return EINA_FALSE;
|
||||||
|
if (eina_streq(part, "efl.text.title"))
|
||||||
{
|
{
|
||||||
if (pd->title_text)
|
if (pd->title_text)
|
||||||
return pd->title_text;
|
return pd->title_text;
|
||||||
|
@ -248,9 +257,10 @@ _efl_ui_alert_popup_efl_object_destructor(Eo *obj, Efl_Ui_Alert_Popup_Data *pd)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_part_is_efl_ui_alert_popup_part(const Eo *obj EINA_UNUSED, const char *part)
|
_part_is_efl_ui_alert_popup_part(const Eo *obj, const char *part)
|
||||||
{
|
{
|
||||||
return (eina_streq(part, "title") || eina_streq(part, "efl.text.title"));
|
if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) return EINA_FALSE;
|
||||||
|
return eina_streq(part, "efl.text.title");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Efl.Part begin */
|
/* Efl.Part begin */
|
||||||
|
@ -261,5 +271,8 @@ ELM_PART_OVERRIDE_TEXT_GET(efl_ui_alert_popup, EFL_UI_ALERT_POPUP, Efl_Ui_Alert_
|
||||||
#include "efl_ui_alert_popup_part.eo.c"
|
#include "efl_ui_alert_popup_part.eo.c"
|
||||||
|
|
||||||
/* Efl.Part end */
|
/* Efl.Part end */
|
||||||
|
EFL_UI_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_alert_popup)
|
||||||
|
|
||||||
|
#define EFL_UI_ALERT_POPUP_EXTRA_OPS \
|
||||||
|
EFL_UI_LAYOUT_TEXT_ALIASES_OPS(efl_ui_alert_popup)
|
||||||
#include "efl_ui_alert_popup.eo.c"
|
#include "efl_ui_alert_popup.eo.c"
|
||||||
|
|
Loading…
Reference in New Issue