summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-09-24 16:59:44 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-09-24 17:12:01 -0400
commitd13bd5fa8e7e6ee844a931424c4db42fa2c9d2c6 (patch)
tree5b09bc5497696c4156345ca0f44fffe27acf3e7e
parent1511430c29b7d2099f9dd4c7237a0dd912e4479e (diff)
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
-rw-r--r--data/elementary/themes/edc/efl/popup.edc1
-rw-r--r--src/lib/elementary/efl_ui_alert_popup.c27
2 files changed, 20 insertions, 8 deletions
diff --git a/data/elementary/themes/edc/efl/popup.edc b/data/elementary/themes/edc/efl/popup.edc
index 176e7b8..22f1a94 100644
--- a/data/elementary/themes/edc/efl/popup.edc
+++ b/data/elementary/themes/edc/efl/popup.edc
@@ -32,7 +32,6 @@ group { "efl/popup";
32group { "efl/alert_popup"; data.item: "version" "123"; 32group { "efl/alert_popup"; data.item: "version" "123";
33 images.image: "rounded_square.png" COMP; 33 images.image: "rounded_square.png" COMP;
34 parts { 34 parts {
35 alias: "title" "efl.text.title";
36 image { "bg"; 35 image { "bg";
37 desc { "default"; 36 desc { "default";
38 min: 100 100; 37 min: 100 100;
diff --git a/src/lib/elementary/efl_ui_alert_popup.c b/src/lib/elementary/efl_ui_alert_popup.c
index 0edfff3..9acc174 100644
--- a/src/lib/elementary/efl_ui_alert_popup.c
+++ b/src/lib/elementary/efl_ui_alert_popup.c
@@ -25,15 +25,24 @@ static const char BUTTON_SWALLOW_NAME[EFL_UI_ALERT_POPUP_BUTTON_COUNT][20] =
25 "efl.button2", 25 "efl.button2",
26 "efl.button3"}; 26 "efl.button3"};
27 27
28static const Elm_Layout_Part_Alias_Description _text_aliases[] =
29{
30 {"title", "efl.text.title"},
31 {NULL, NULL}
32};
33
28static Eina_Bool 34static Eina_Bool
29_efl_ui_alert_popup_text_set(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, const char *part, const char *label) 35_efl_ui_alert_popup_text_set(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, const char *part, const char *label)
30{ 36{
31 if (eina_streq(part, "title") || eina_streq(part, "efl.text.title")) 37 if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE))
38 return EINA_FALSE;
39 efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
40 if (eina_streq(part, "efl.text.title"))
32 { 41 {
33 Eina_Bool changed = eina_stringshare_replace(&pd->title_text, label); 42 Eina_Bool changed = eina_stringshare_replace(&pd->title_text, label);
34 if (changed) 43 if (changed)
35 { 44 {
36 efl_text_set(efl_part(efl_super(obj, MY_CLASS), "title"), label); 45 efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
37 if (label) 46 if (label)
38 elm_layout_signal_emit(obj, "efl,title,show", "efl"); 47 elm_layout_signal_emit(obj, "efl,title,show", "efl");
39 else 48 else
@@ -44,8 +53,6 @@ _efl_ui_alert_popup_text_set(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, const char *p
44 efl_canvas_group_change(obj); 53 efl_canvas_group_change(obj);
45 } 54 }
46 } 55 }
47 else
48 efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
49 56
50 return EINA_TRUE; 57 return EINA_TRUE;
51} 58}
@@ -53,7 +60,9 @@ _efl_ui_alert_popup_text_set(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, const char *p
53const char * 60const char *
54_efl_ui_alert_popup_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Alert_Popup_Data *pd, const char *part) 61_efl_ui_alert_popup_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Alert_Popup_Data *pd, const char *part)
55{ 62{
56 if (eina_streq(part, "title") || eina_streq(part, "efl.text.title")) 63 if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE))
64 return EINA_FALSE;
65 if (eina_streq(part, "efl.text.title"))
57 { 66 {
58 if (pd->title_text) 67 if (pd->title_text)
59 return pd->title_text; 68 return pd->title_text;
@@ -248,9 +257,10 @@ _efl_ui_alert_popup_efl_object_destructor(Eo *obj, Efl_Ui_Alert_Popup_Data *pd)
248} 257}
249 258
250static Eina_Bool 259static Eina_Bool
251_part_is_efl_ui_alert_popup_part(const Eo *obj EINA_UNUSED, const char *part) 260_part_is_efl_ui_alert_popup_part(const Eo *obj, const char *part)
252{ 261{
253 return (eina_streq(part, "title") || eina_streq(part, "efl.text.title")); 262 if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE)) return EINA_FALSE;
263 return eina_streq(part, "efl.text.title");
254} 264}
255 265
256/* Efl.Part begin */ 266/* Efl.Part begin */
@@ -261,5 +271,8 @@ ELM_PART_OVERRIDE_TEXT_GET(efl_ui_alert_popup, EFL_UI_ALERT_POPUP, Efl_Ui_Alert_
261#include "efl_ui_alert_popup_part.eo.c" 271#include "efl_ui_alert_popup_part.eo.c"
262 272
263/* Efl.Part end */ 273/* Efl.Part end */
274EFL_UI_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_alert_popup)
264 275
276#define EFL_UI_ALERT_POPUP_EXTRA_OPS \
277 EFL_UI_LAYOUT_TEXT_ALIASES_OPS(efl_ui_alert_popup)
265#include "efl_ui_alert_popup.eo.c" 278#include "efl_ui_alert_popup.eo.c"