--- /dev/null
+group {
+ name: "elm/button/base/contacts-btn";
+
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 0;
+ color_class: "action";
+ }
+ description {
+ state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+
+ part {
+ name: "elm.text.phone";
+ type: TEXT;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 255;
+ color_class: "action";
+ rel2 {
+ relative: 1.0 0.5;
+ }
+ text {
+ font: FONT_NORMAL;
+ size: SIZE_MEDIUM;
+ size_range: SIZE_TINY SIZE_HUGE;
+ fit: 1 1;
+ align: 0.5 0.5;
+ ellipsis: 1.0;
+ }
+ }
+ description {
+ state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ color: 16 16 16 255;
+ }
+ }
+
+ part {
+ name: "elm.text.type";
+ type: TEXT;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 128;
+ color_class: "action";
+ rel1 {
+ to: "elm.text.phone";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 0;
+ }
+ text {
+ font: FONT_NORMAL;
+ size: SIZE_MEDIUM;
+ size_range: SIZE_TINY SIZE_HUGE;
+ fit: 1 1;
+ align: 0.5 0.5;
+ ellipsis: 0.0;
+ }
+ }
+ description {
+ state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ color: 16 16 16 255;
+ }
+ }
+ }
+
+ programs {
+
+ program {
+ signal: "mouse,clicked,1";
+ source: "bg";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+
+ program {
+ signal: "mouse,down,1";
+ source: "bg";
+ transition: ACCELERATE 0.3;
+ action: STATE_SET "pressed" 0.0;
+ target: "bg";
+ target: "elm.text.phone";
+ target: "elm.text.type";
+ }
+
+ program {
+ signal: "mouse,up,1";
+ source: "bg";
+ transition: DECELERATE 0.3;
+ action: STATE_SET "default" 0.0;
+ target: "bg";
+ target: "elm.text.phone";
+ target: "elm.text.type";
+ }
+ }
+}
Contacts *contacts = data;
Elm_Object_Item *item = event_inf;
Evas_Object *details, *btn;
- char buf[1024];
Contact_Info *c_info;
char *phone;
btn = elm_button_add(details);
EINA_SAFETY_ON_NULL_RETURN(btn);
+ elm_object_style_set(btn, "contacts-btn");
phone = phone_format(c_info->mobile);
- snprintf(buf, sizeof(buf), "Mobile: %s", phone);
+ elm_object_part_text_set(btn, "elm.text.type", "Mobile");
+ elm_object_part_text_set(btn, "elm.text.phone", phone);
free(phone);
- elm_object_part_text_set(btn, NULL, buf);
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
btn = elm_button_add(details);
EINA_SAFETY_ON_NULL_RETURN(btn);
+ elm_object_style_set(btn, "contacts-btn");
phone = phone_format(c_info->home);
- snprintf(buf, sizeof(buf), "Home: %s", phone);
+ elm_object_part_text_set(btn, "elm.text.type", "Home");
+ elm_object_part_text_set(btn, "elm.text.phone", phone);
free(phone);
- elm_object_part_text_set(btn, NULL, buf);
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
btn = elm_button_add(details);
EINA_SAFETY_ON_NULL_RETURN(btn);
+ elm_object_style_set(btn, "contacts-btn");
phone = phone_format(c_info->work);
- snprintf(buf, sizeof(buf), "Work: %s", phone);
+ elm_object_part_text_set(btn, "elm.text.type", "Work");
+ elm_object_part_text_set(btn, "elm.text.phone", phone);
free(phone);
- elm_object_part_text_set(btn, NULL, buf);
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);