elm_dayselector: fix improperly named API theme parts

Summary:
API parts require namespacing, these parts have been namespaced with
compatibility code added to handle legacy naming
Depends on D6210

Reviewers: cedric

Reviewed By: cedric

Subscribers: #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6211
This commit is contained in:
Mike Blumenkrantz 2018-06-19 13:28:15 -04:00
parent 3c094d8146
commit 9889352bc0
2 changed files with 61 additions and 21 deletions

View File

@ -9,8 +9,9 @@
#define DAYSELECOR_DAY_STATE_SELECTED 3 #define DAYSELECOR_DAY_STATE_SELECTED 3
#define DAYSELECTOR_DAY(_pos, _after)\ #define DAYSELECTOR_DAY(_pos, _after)\
alias: "day"#_pos "elm.swallow.day"#_pos; \
part {\ part {\
name: "day"#_pos;\ name: "elm.swallow.day"#_pos;\
type: SWALLOW;\ type: SWALLOW;\
scale: 1;\ scale: 1;\
clip_to: "clipper";\ clip_to: "clipper";\
@ -21,12 +22,12 @@
fixed: 1 0;\ fixed: 1 0;\
rel1 {\ rel1 {\
relative: 1.0 0.0;\ relative: 1.0 0.0;\
to: "day"#_after;\ to: "elm.swallow.day"#_after;\
offset: 0 0;\ offset: 0 0;\
}\ }\
rel2 {\ rel2 {\
relative: 1.0 1.0;\ relative: 1.0 1.0;\
to: "day"#_after;\ to: "elm.swallow.day"#_after;\
}\ }\
}\ }\
description { state: "visible" 0.0;\ description { state: "visible" 0.0;\
@ -38,24 +39,24 @@
programs{\ programs{\
program {\ program {\
name: "day"#_pos"visible";\ name: "day"#_pos"visible";\
signal: "day"#_pos",visible";\ signal: "elm,day"#_pos",visible";\
source: "elm";\ source: "elm";\
action: STATE_SET "visible" 0.0;\ action: STATE_SET "visible" 0.0;\
target: "day"#_pos;\ target: "elm.swallow.day"#_pos;\
}\ }\
program {\ program {\
name: "day"#_pos"notvisible";\ name: "day"#_pos"notvisible";\
signal: "day"#_pos",default";\ signal: "elm,day"#_pos",default";\
source: "elm";\ source: "elm";\
action: STATE_SET "default" 0.0;\ action: STATE_SET "default" 0.0;\
target: "day"#_pos;\ target: "elm.swallow.day"#_pos;\
}\ }\
} }
group { name: "elm/dayselector/base/default"; group { name: "elm/dayselector/base/default";
parts { parts {
part { part {
name: "day0"; name: "elm.swallow.day0";
type: SWALLOW; type: SWALLOW;
scale: 1; scale: 1;
clip_to: "clipper"; clip_to: "clipper";
@ -82,8 +83,8 @@ group { name: "elm/dayselector/base/default";
type: RECT; type: RECT;
description { description {
state: "default" 0.0; state: "default" 0.0;
rel1.to: "day0"; rel1.to: "elm.swallow.day0";
rel2.to: "day6"; rel2.to: "elm.swallow.day6";
} }
description { description {
state: "visible" 0.0; state: "visible" 0.0;
@ -125,17 +126,17 @@ group { name: "elm/dayselector/base/default";
} }
program { program {
name: "day0_visible"; name: "day0_visible";
signal: "day0,visible"; signal: "elm,day0,visible";
source: "elm"; source: "elm";
action: STATE_SET "visible" 0.0; action: STATE_SET "visible" 0.0;
target: "day0"; target: "elm.swallow.day0";
} }
program { program {
name: "day0_default"; name: "day0_default";
signal: "day0,default"; signal: "elm,day0,default";
source: "elm"; source: "elm";
action: STATE_SET "default" 0.0; action: STATE_SET "default" 0.0;
target: "day0"; target: "elm.swallow.day0";
} }
} }
} }

View File

@ -141,9 +141,14 @@ _elm_dayselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Dayselector_Data *sd)
(buf, sizeof(buf), "dayselector/%s", elm_object_style_get(obj)); (buf, sizeof(buf), "dayselector/%s", elm_object_style_get(obj));
elm_object_style_set(VIEW(it), buf); elm_object_style_set(VIEW(it), buf);
/* XXX kept for legacy compatibility, remove eventually */
snprintf snprintf
(buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it)); (buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm"); elm_layout_signal_emit(obj, buf, "elm");
/* XXX */
snprintf
(buf, sizeof(buf), "elm,day%d,visible", _item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm");
} }
_update_items(obj); _update_items(obj);
@ -170,9 +175,14 @@ _item_del_cb(void *data,
{ {
sd->items = eina_list_remove(sd->items, it); sd->items = eina_list_remove(sd->items, it);
eina_stringshare_del(it->day_style); eina_stringshare_del(it->day_style);
/* XXX kept for legacy compatibility, remove eventually */
snprintf(buf, sizeof(buf), "day%d,default", snprintf(buf, sizeof(buf), "day%d,default",
_item_location_get(sd, it)); _item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm"); elm_layout_signal_emit(obj, buf, "elm");
/* XXX */
snprintf(buf, sizeof(buf), "elm,day%d,default",
_item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm");
// The object is already being deleted, there is no point in calling efl_del on it nore setting it to NULL. // The object is already being deleted, there is no point in calling efl_del on it nore setting it to NULL.
@ -234,9 +244,17 @@ _elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item
it = _item_find(obj, day); it = _item_find(obj, day);
if (it) if (it)
{ {
snprintf(buf, sizeof(buf), "elm.swallow.day%d", _item_location_get(sd, it));
int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content);
if (!int_ret)
{
/* XXX kept for legacy compatibility, remove eventually */
snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it)); snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content); int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content);
/* XXX */
}
if (!int_ret) return EINA_FALSE; if (!int_ret) return EINA_FALSE;
if (!content) return EINA_TRUE; /* item deletion already handled */ if (!content) return EINA_TRUE; /* item deletion already handled */
@ -250,9 +268,17 @@ _elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item
it = efl_data_scope_get(eo_it, ELM_DAYSELECTOR_ITEM_CLASS); it = efl_data_scope_get(eo_it, ELM_DAYSELECTOR_ITEM_CLASS);
it->day = day; it->day = day;
snprintf(buf, sizeof(buf), "elm.swallow.day%d", _item_location_get(sd, it));
int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content);
if (!int_ret)
{
/* XXX kept for legacy compatibility, remove eventually */
snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it)); snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content); int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content);
/* XXX */
}
if (!int_ret) if (!int_ret)
{ {
efl_del(eo_it); efl_del(eo_it);
@ -263,6 +289,9 @@ _elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item
VIEW_SET(it, content); VIEW_SET(it, content);
} }
snprintf(buf, sizeof(buf), "elm,day%d,visible", _item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm");
/* XXX kept for legacy compatibility, remove eventually */
snprintf(buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it)); snprintf(buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm"); elm_layout_signal_emit(obj, buf, "elm");
@ -325,6 +354,9 @@ _elm_dayselector_content_unset(Eo *obj, Elm_Dayselector_Data *sd, const char *it
elm_object_signal_callback_del elm_object_signal_callback_del
(content, ITEM_TYPE_WEEKEND_STYLE1, "*", _item_signal_emit_cb); (content, ITEM_TYPE_WEEKEND_STYLE1, "*", _item_signal_emit_cb);
snprintf(buf, sizeof(buf), "elm,day%d,default", _item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm");
/* XXX kept for legacy compatibility, remove eventually */
snprintf(buf, sizeof(buf), "day%d,default", _item_location_get(sd, it)); snprintf(buf, sizeof(buf), "day%d,default", _item_location_get(sd, it));
elm_layout_signal_emit(obj, buf, "elm"); elm_layout_signal_emit(obj, buf, "elm");
@ -393,8 +425,12 @@ _items_create(Evas_Object *obj)
strftime(buf, sizeof(buf), "%a", &time_daysel); strftime(buf, sizeof(buf), "%a", &time_daysel);
elm_object_text_set(chk, buf); elm_object_text_set(chk, buf);
snprintf(buf, sizeof(buf), "elm.swallow.day%u", idx);
if (!elm_layout_content_set(obj, buf, chk))
{
snprintf(buf, sizeof(buf), "day%u", idx); snprintf(buf, sizeof(buf), "day%u", idx);
elm_layout_content_set(obj, buf, chk); elm_layout_content_set(obj, buf, chk);
}
// XXX: ACCESS // XXX: ACCESS
_elm_access_text_set(_elm_access_info_get(chk), _elm_access_text_set(_elm_access_info_get(chk),
@ -495,10 +531,13 @@ _elm_dayselector_week_start_set(Eo *obj, Elm_Dayselector_Data *sd, Elm_Dayselect
/* just shuffling items, so swalling them directly */ /* just shuffling items, so swalling them directly */
sd->week_start = day; sd->week_start = day;
EINA_LIST_FOREACH(sd->items, l, it) EINA_LIST_FOREACH(sd->items, l, it)
{
snprintf(buf, sizeof(buf), "elm.swallow.day%d", _item_location_get(sd, it));
if (!edje_object_part_swallow(wd->resize_obj, buf, VIEW(it)))
{ {
snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it)); snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
edje_object_part_swallow edje_object_part_swallow(wd->resize_obj, buf, VIEW(it));
(wd->resize_obj, buf, VIEW(it)); }
} }
_update_items(obj); _update_items(obj);