*/
static void Del(void *data, Evas_Object *obj);
- /**
- * @brief Creates evas object for time
- *
- * @param parent parent
- *
- * @return the object
- */
- static Evas_Object *CreateTimeObject(Evas_Object *parent, utils::Time t);
-
- /**
- * @brief Creates evas object for meridiem
- *
- * @param parent parent
- *
- * @return the object
- */
- static Evas_Object *CreateXMeridiemObject(Evas_Object *parent, utils::Time t);
-
/**
* @brief Creates evas object for padding
*
*/
static void Del(void *data, Evas_Object *obj);
- /**
- * @brief Creates evas object for time
- *
- * @param parent parent
- *
- * @return the object
- */
- static Evas_Object *CreateTimeObject(Evas_Object *parent, utils::Time t);
-
- /**
- * @brief Creates evas object for meridiem
- *
- * @param parent parent
- *
- * @return the object
- */
- static Evas_Object *CreateXMeridiemObject(Evas_Object *parent, utils::Time t);
-
/**
* @brief Creates evas object for padding
*
group { name: "elm/genlist/item/worldclock.delete/reorder.list/default";
styles {
+ style { name: "time_ATO040";
+ base: "font=Tizen:style=Light color=#000000ff font_size=50 align=left";
+ }
+ style { name: "ampm_ATO041";
+ base: "font=Tizen:style=Medium color=#000000ff font_size=30 align=left";
+ }
style { name: "date_ATO042";
base: "font=Tizen:style=Regular color=#808080ff font_size=30 align=left";
}
}
}
data.item: "banded_bg_area" "elm.swallow.bg";
- data.item: "texts" "date city.country gmt.offset.desc";
- data.item: "contents" "time sw.item";
+ data.item: "texts" "time ampm date city.country gmt.offset.desc";
+ data.item: "contents" "sw.item";
parts {
spacer { "base"; scale;
desc { "default";
rel1.to: "base";
}
}
- swallow { "time"; scale;
+ spacer { "time.bg"; scale;
desc { "default";
min: 173 67;
max: 173 67;
}
}
}
+ textblock { "time"; scale;
+ desc { "default";
+ rel1.to: "time.bg";
+ rel2.to: "time.bg";
+ align: 0.0 0.5;
+ text {
+ style: "time_ATO040";
+ min: 1 0;
+ max: 1 0;
+ align: 0.0 1.0;
+ }
+ }
+ }
+ spacer { "padding.time"; scale;
+ desc { "default";
+ min: 8 0;
+ max: 8 -1;
+ fixed: 1 0;
+ align: 0.0 0.5;
+ rel1 {
+ relative: 1.0 0.0;
+ to_x: "time";
+ to_y: "time.bg";
+ }
+ rel2.to: "time.bg";
+ }
+ }
+ spacer { "padding.ampm"; scale;
+ desc { "default";
+ min: 0 6;
+ max: -1 6;
+ fixed: 0 1;
+ align: 0.5 1.0;
+ rel1.to: "time.bg";
+ rel2.to: "time.bg";
+ }
+ }
+ textblock { "ampm"; scale;
+ desc { "default";
+ min: 0 40;
+ max: -1 40;
+ fixed: 0 1;
+ align: 0.0 1.0;
+ rel1 {
+ relative: 1.0 0.0;
+ to_x: "padding.time";
+ to_y: "time.bg";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ to_x: "time.bg";
+ to_y: "padding.ampm";
+ }
+ text {
+ style: "ampm_ATO041";
+ max: 1 0;
+ align: 0.0 0.5;
+ }
+ }
+ }
spacer { "padding.middle"; scale;
desc { "default";
min: 82 0;
{
LocationDeleteItemData *ldid = static_cast<LocationDeleteItemData *>(data);
- if (!strcmp(part, "time")) {
- Time t = Time::Now().InTimezone(ldid->location->tzpath.c_str());
-
- ldid->time = elm_table_add(obj);
- evas_object_size_hint_align_set(ldid->time, 0.0, 0.0);
-
- Evas_Object *time = CreateTimeObject(ldid->time, t);
- Evas_Object *padding = CreatePaddingObject(ldid->time, 8);
- Evas_Object *ampm = CreateXMeridiemObject(ldid->time, t);
-
- Evas_Object *dynamic_padding = elm_bg_add(ldid->time);
- evas_object_color_set(dynamic_padding, 0, 0, 0, 0);
- evas_object_size_hint_weight_set(dynamic_padding, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
- elm_table_pack(ldid->time, time, 0, 0, 1, 1);
- elm_table_pack(ldid->time, padding, 1, 0, 1, 1);
- elm_table_pack(ldid->time, ampm, 2, 0, 1, 1);
- elm_table_pack(ldid->time, dynamic_padding, 3, 0, 1, 1);
-
- return ldid->time;
-
- } else if (!strcmp(part, "sw.item")) {
+ if (!strcmp(part, "sw.item")) {
ldid->checkbox = elm_check_add(obj);
evas_object_propagate_events_set(ldid->checkbox, EINA_FALSE);
elm_check_state_set(ldid->checkbox, ldid->selected ? EINA_TRUE : EINA_FALSE);
return strdup(ldid->city_country);
if (!strcmp(part, "gmt.offset.desc"))
return strdup(ldid->gmt_offset_relative);
+ if (!strcmp(part, "time")) {
+ Time t = Time::Now().InTimezone(ldid->location->tzpath.c_str());
+
+ std::string timezone_time;
+ if (Time::Is24HourFormatPrefered())
+ timezone_time = t.Format("HH:mm");
+ else
+ timezone_time = t.Format("h:mm");
+
+ char time_formatted[MAX_STYLE_LEN] = { 0, };
+ snprintf(time_formatted, sizeof(time_formatted),
+ CUSTOM_LIST_TIME_STYLE("%s"), timezone_time.c_str());
+
+ return strdup(time_formatted);
+ }
+ if (!strcmp(part, "ampm")) {
+ if (Time::Is24HourFormatPrefered())
+ return NULL;
+
+ char ampm_formatted[MAX_STYLE_LEN] = { 0, };
+ std::string meridiem;
+
+ Time t = Time::Now().InTimezone(ldid->location->tzpath.c_str());
+ meridiem = t.Format("a");
+
+ snprintf(ampm_formatted, sizeof(ampm_formatted),
+ CUSTOM_LIST_AMPM_STYLE("%s"), meridiem.c_str());
+
+ return strdup(ampm_formatted);
+ }
return nullptr;
}
delete ldid;
}
-Evas_Object *WorldClockDeleteItemsView::CreateTimeObject(Evas_Object *parent, Time t)
-{
- std::string timezone_time;
-
- Evas_Object *label = elm_label_add(parent);
- evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
- if (Time::Is24HourFormatPrefered())
- timezone_time = t.Format("HH:mm");
- else
- timezone_time = t.Format("h:mm");
-
- char time_formatted[MAX_STYLE_LEN] = { 0, };
- snprintf(time_formatted, sizeof(time_formatted),
- CUSTOM_LIST_TIME_STYLE("%s"), timezone_time.c_str());
- elm_object_text_set(label, time_formatted);
-
- evas_object_show(label);
-
-
- return label;
-}
-
-Evas_Object *WorldClockDeleteItemsView::CreateXMeridiemObject(Evas_Object *parent, Time t)
-{
- char ampm_formatted[MAX_STYLE_LEN] = { 0, };
-
- Evas_Object *ampm = elm_label_add(parent);
- evas_object_size_hint_align_set(ampm, EVAS_HINT_FILL, 0.75);
-
- if (!Time::Is24HourFormatPrefered()) {
- std::string meridiem = t.Format("a");
- snprintf(ampm_formatted, sizeof(ampm_formatted),
- CUSTOM_LIST_AMPM_STYLE("%s"), meridiem.c_str());
- }
- elm_object_text_set(ampm, ampm_formatted);
-
- evas_object_show(ampm);
-
- return ampm;
-}
-
Evas_Object *WorldClockDeleteItemsView::CreatePaddingObject(Evas_Object *parent, int width)
{
Evas_Object *padding = elm_bg_add(parent);
{
LocationReorderItemData *lrid = static_cast<LocationReorderItemData *>(data);
- if (!strcmp(part, "time")) {
- Time t = Time::Now().InTimezone(lrid->location->tzpath.c_str());
-
- lrid->time = elm_table_add(obj);
- evas_object_size_hint_align_set(lrid->time, 0.0, 0.0);
-
- Evas_Object *time = CreateTimeObject(lrid->time, t);
- Evas_Object *padding = CreatePaddingObject(lrid->time, 8);
- Evas_Object *ampm = CreateXMeridiemObject(lrid->time, t);
-
- Evas_Object *dynamic_padding = elm_bg_add(lrid->time);
- evas_object_color_set(dynamic_padding, 0, 0, 0, 0);
- evas_object_size_hint_weight_set(dynamic_padding, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
- elm_table_pack(lrid->time, time, 0, 0, 1, 1);
- elm_table_pack(lrid->time, padding, 1, 0, 1, 1);
- elm_table_pack(lrid->time, ampm, 2, 0, 1, 1);
- elm_table_pack(lrid->time, dynamic_padding, 3, 0, 1, 1);
-
- return lrid->time;
- } else if (!strcmp(part, "sw.item")) {
+ if (!strcmp(part, "sw.item")) {
Evas_Object *img = elm_image_add(obj);
evas_object_size_hint_weight_set(img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
return strdup(lrid->city_country);
if (!strcmp(part, "gmt.offset.desc"))
return strdup(lrid->gmt_offset_relative);
+ if (!strcmp(part, "time")) {
+ Time t = Time::Now().InTimezone(lrid->location->tzpath.c_str());
- return nullptr;
-}
-
-void WorldClockReorderView::Del(void* data, Evas_Object* obj)
-{
- LocationReorderItemData *lrid = static_cast<LocationReorderItemData *>(data);
+ std::string timezone_time;
+ if (Time::Is24HourFormatPrefered())
+ timezone_time = t.Format("HH:mm");
+ else
+ timezone_time = t.Format("h:mm");
- free(lrid->city_country);
- free(lrid->date);
- free(lrid->gmt_offset_relative);
- delete lrid;
-}
+ char time_formatted[MAX_STYLE_LEN] = { 0, };
+ snprintf(time_formatted, sizeof(time_formatted),
+ CUSTOM_LIST_TIME_STYLE("%s"), timezone_time.c_str());
-Evas_Object *WorldClockReorderView::CreateTimeObject(Evas_Object *parent, Time t)
-{
- Evas_Object *label = elm_label_add(parent);
- evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ return strdup(time_formatted);
+ }
+ if (!strcmp(part, "ampm")) {
+ if (Time::Is24HourFormatPrefered())
+ return NULL;
- std::string timezone_time;
+ char ampm_formatted[MAX_STYLE_LEN] = { 0, };
+ std::string meridiem;
- if (Time::Is24HourFormatPrefered())
- timezone_time = t.Format("HH:mm");
- else
- timezone_time = t.Format("h:mm");
+ Time t = Time::Now().InTimezone(lrid->location->tzpath.c_str());
+ meridiem = t.Format("a");
- char time_formatted[MAX_STYLE_LEN] = { 0, };
- snprintf(time_formatted, sizeof(time_formatted),
- CUSTOM_LIST_TIME_STYLE("%s"), timezone_time.c_str());
- elm_object_text_set(label, time_formatted);
+ snprintf(ampm_formatted, sizeof(ampm_formatted),
+ CUSTOM_LIST_AMPM_STYLE("%s"), meridiem.c_str());
- evas_object_show(label);
+ return strdup(ampm_formatted);
+ }
- return label;
+ return nullptr;
}
-Evas_Object *WorldClockReorderView::CreateXMeridiemObject(Evas_Object *parent, Time t)
+void WorldClockReorderView::Del(void* data, Evas_Object* obj)
{
- char ampm_formatted[MAX_STYLE_LEN] = { 0, };
- Evas_Object *ampm = elm_label_add(parent);
- evas_object_size_hint_align_set(ampm, EVAS_HINT_FILL, 0.75);
-
- std::string meridiem = t.Format("a");
- if (!Time::Is24HourFormatPrefered()) {
- std::string meridiem = t.Format(Time::FORMAT_TIME_AMPM);
- snprintf(ampm_formatted, sizeof(ampm_formatted),
- CUSTOM_LIST_AMPM_STYLE("%s"), meridiem.c_str());
- }
- elm_object_text_set(ampm, ampm_formatted);
-
- evas_object_show(ampm);
+ LocationReorderItemData *lrid = static_cast<LocationReorderItemData *>(data);
- return ampm;
+ free(lrid->city_country);
+ free(lrid->date);
+ free(lrid->gmt_offset_relative);
+ delete lrid;
}
Evas_Object *WorldClockReorderView::CreatePaddingObject(Evas_Object *parent, int width)