From 32f9ac2ea415c6dedb7908ad7292563d8e90e62e Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Fri, 3 Aug 2012 14:12:25 -0300 Subject: [PATCH] multiple improvements to history look and feel. * history.c, scroller.edc (from multiparty-list.edc): use scroller theme for genlist similar to multiparty details. * history.c: history formats line_id using phone_format() function. * history-bg.edc: smaller buttons for "All" and "Missed", with text centered (no subtitle). * history-bg.edc: lists will go up to the scroller (rel1). * history.edc: list items are bigger (120px), allowing more space between items. Fixed positioning of time and type parts. --- Makefile.am | 3 +- data/themes/default.edc | 1 + data/themes/includes/history-bg.edc | 58 ++------ data/themes/includes/history.edc | 15 ++- data/themes/includes/multiparty-list.edc | 219 ------------------------------- data/themes/includes/scroller.edc | 219 +++++++++++++++++++++++++++++++ dialer/history.c | 8 +- 7 files changed, 243 insertions(+), 280 deletions(-) create mode 100644 data/themes/includes/scroller.edc diff --git a/Makefile.am b/Makefile.am index c6d66e7..b69c253 100644 --- a/Makefile.am +++ b/Makefile.am @@ -97,7 +97,8 @@ data/themes/includes/history-bg.edc \ data/themes/includes/history.edc \ data/themes/includes/keypad.edc \ data/themes/includes/main.edc \ -data/themes/includes/multiparty-list.edc +data/themes/includes/multiparty-list.edc \ +data/themes/includes/scroller.edc EXTRA_DIST = data/themes/default.edc $(THEME_INCLUDES) $(THEME_IMAGES) diff --git a/data/themes/default.edc b/data/themes/default.edc index bbaef07..b868d6d 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -7,5 +7,6 @@ collections { #include "includes/multiparty-list.edc" #include "includes/history.edc" #include "includes/history-bg.edc" +#include "includes/scroller.edc" } diff --git a/data/themes/includes/history-bg.edc b/data/themes/includes/history-bg.edc index ec00e3e..bb96a25 100644 --- a/data/themes/includes/history-bg.edc +++ b/data/themes/includes/history-bg.edc @@ -32,10 +32,10 @@ group { description { state: "default" 0.0; color: 0 0 0 0; - min: 720 170; + min: 720 85; rel2 { relative: 1.0 0.0; - offset: -1.0 169; + offset: -1.0 84; } } } @@ -90,11 +90,8 @@ group { description { state: "default" 0.0; rel1 { - relative: 0.0 0.0; - offset: 0.0 210; - } - rel2 { - relative: 1.0 1.0; + to_y: "separator.bg.button"; + relative: 0.0 1.0; } visible: 1; } @@ -110,16 +107,10 @@ group { type: SWALLOW; description { state: "default" 0.0; - rel1 { + to_y: "separator.bg.button"; relative: 0.0 0.0; - offset: 0.0 210; } - - rel2 { - relative: 1.0 1.0; - } - visible: 0; } description { @@ -128,7 +119,8 @@ group { visible: 1; } } -#define BUTTON(id, label, sub, ccls, r1, r2) \ + +#define BUTTON(id, label, ccls, r1, r2) \ part { \ name: "button."##id; \ type: RECT; \ @@ -137,7 +129,6 @@ group { state: "default" 0.0; \ color: 255 255 255 0; \ color_class: "action"; \ - \ rel1 { \ to: "bg.buttons"; \ relative: r1; \ @@ -145,7 +136,6 @@ group { rel2 { \ to: "bg.buttons"; \ relative: r2; \ - offset: 0 0; \ } \ } \ description { \ @@ -165,7 +155,6 @@ group { rel1.to: "button."##id; \ rel2 { \ to: "button."##id; \ - relative: 1.0 0.8; \ } \ text { \ text: label; \ @@ -180,33 +169,6 @@ group { color: 16 16 16 255; \ } \ } \ - part { \ - name: "sub."##id; \ - type: TEXT; \ - mouse_events: 0; \ - description { \ - state: "default" 0.0; \ - color: 255 255 255 255; \ - color_class: "light"; \ - rel1 { \ - to: "button."##id; \ - relative: 0.0 0.5; \ - offset: 0 2; \ - } \ - rel2.to: "button."##id; \ - text { \ - text: sub; \ - font: "Verdana:style=Bold"; \ - size: 16; \ - align: 0.5 0.5; \ - } \ - } \ - description { \ - state: "pressed" 0.0; \ - inherit: "default" 0.0; \ - color: 16 16 16 255; \ - } \ - } \ \ programs { \ program { \ @@ -215,7 +177,6 @@ group { action: STATE_SET "pressed" 0.0; \ target: "button."##id; \ target: "label."##id; \ - target: "sub."##id; \ } \ program { \ signal: "toggle,off,"##id; \ @@ -223,7 +184,6 @@ group { action: STATE_SET "default" 0.0; \ target: "button."##id; \ target: "label."##id; \ - target: "sub."##id; \ } \ program { \ signal: "mouse,clicked,1"; \ @@ -233,8 +193,8 @@ group { } \ } - BUTTON("all", "All", "", "action", 0.0 0.0, 0.5 1.0); - BUTTON("missed", "Missed", "", "action", 0.5 0.0, 1.0 1.0); + BUTTON("all", "All", "action", 0.0 0.0, 0.5 1.0); + BUTTON("missed", "Missed", "action", 0.5 0.0, 1.0 1.0); #undef BUTTON } programs { diff --git a/data/themes/includes/history.edc b/data/themes/includes/history.edc index 2c78b08..69b6b8f 100644 --- a/data/themes/includes/history.edc +++ b/data/themes/includes/history.edc @@ -41,12 +41,12 @@ group { part { name: "bg"; type: RECT; + scale: 1; mouse_events: 0; description { state: "default" 0.0; color: 0 0 0 0; - min: 240 100; - max: 240 100; + min: 240 120; } } part { @@ -60,7 +60,7 @@ group { color_class: "action"; rel1 { relative: 0.0 0.0; - offset: 40 0; + offset: 40 26; } rel2 { to_x: "call.swallow.more"; @@ -98,7 +98,7 @@ group { } rel2 { relative: 0.5 1.0; - offset: 0 69; + offset: -41 -27; } text { font: "Verdana"; @@ -127,11 +127,12 @@ group { color_class: "action"; rel1 { relative: 0.5 0.5; - offset: -60 0; + offset: 0 0; } rel2 { - relative: 0.5 0.5; - offset: 200 70; + to_x: "call.swallow.more"; + relative: 0.0 1.0; + offset: -16 -27; } text { font: "Verdana"; diff --git a/data/themes/includes/multiparty-list.edc b/data/themes/includes/multiparty-list.edc index adae8bb..55f79b3 100644 --- a/data/themes/includes/multiparty-list.edc +++ b/data/themes/includes/multiparty-list.edc @@ -1,223 +1,4 @@ group { - name: "elm/scroller/base/multiparty-details"; - - script { - public sbvis_v, sbalways_v, sbvis_timer; - public timer0(val) { - new v; - v = get_int(sbvis_v); - if (v) { - v = get_int(sbalways_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - set_int(sbvis_timer, 0); - return 0; - } - } - - parts { - part { - name: "clipper"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - } - } - - part { - name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - description { - state: "default" 0.0; - } - } - - part { - name: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - } - description { - state: "hidden" 0.0; - color: 255 255 255 0; - visible: 0; - } - } - - part { - name: "sb_vbar_clip"; - clip_to: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - } - description { - state: "hidden" 0.0; - color: 255 255 255 0; - visible: 0; - } - } - - part { - name: "sb_vbar"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 16 16; - align: 1.0 0.0; - rel1 { - relative: 1.0 0.0; - offset: -1 0; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - } - } - } - - part { - name: "elm.dragable.vbar"; - type: RECT; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - dragable { - x: 0 0 0; - y: 1 1 0; - confine: "sb_vbar"; - } - description { - state: "default" 0.0; - color: 255 255 255 255; - color_class: "light"; - fixed: 1 1; - min: 16 16; - max: 16 99999; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - } - } - } - - programs { - program { - signal: "load"; - source: ""; - script { - set_state(PART:"sb_vbar_clip", "hidden", 0.0); - set_int(sbvis_v, 0); - set_int(sbalways_v, 0); - set_int(sbvis_timer, 0); - } - } - - program { - name: "vbar_show"; - signal: "elm,action,show,vbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_vbar_clip_master"; - } - - program { - name: "vbar_hide"; - signal: "elm,action,hide,vbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_vbar_clip_master"; - } - - program { - name: "vbar_show_always"; - signal: "elm,action,show_always,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - set_int(sbalways_v, 1); - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - } - } - - program { - name: "vbar_show_notalways"; - signal: "elm,action,show_notalways,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_v); - if (v) { - set_int(sbalways_v, 0); - v = get_int(sbvis_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - } - } - - program { - signal: "do-show-vbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - - program { - signal: "do-hide-vbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - - program { - name: "scroll"; - signal: "elm,action,scroll"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - v = get_int(sbvis_timer); - if (v > 0) cancel_timer(v); - v = timer(1.0, "timer0", 0); - set_int(sbvis_timer, v); - } - } - } -} - -group { name: "elm/layout/dialer/multiparty-details"; images { diff --git a/data/themes/includes/scroller.edc b/data/themes/includes/scroller.edc new file mode 100644 index 0000000..1333370 --- /dev/null +++ b/data/themes/includes/scroller.edc @@ -0,0 +1,219 @@ +group { + name: "elm/scroller/base/multiparty-details"; + alias: "elm/genlist/base/history"; + + script { + public sbvis_v, sbalways_v, sbvis_timer; + public timer0(val) { + new v; + v = get_int(sbvis_v); + if (v) { + v = get_int(sbalways_v); + if (!v) { + emit("do-hide-vbar", ""); + set_int(sbvis_v, 0); + } + } + set_int(sbvis_timer, 0); + return 0; + } + } + + parts { + part { + name: "clipper"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + } + } + + part { + name: "elm.swallow.content"; + clip_to: "clipper"; + type: SWALLOW; + description { + state: "default" 0.0; + } + } + + part { + name: "sb_vbar_clip_master"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + } + description { + state: "hidden" 0.0; + color: 255 255 255 0; + visible: 0; + } + } + + part { + name: "sb_vbar_clip"; + clip_to: "sb_vbar_clip_master"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + } + description { + state: "hidden" 0.0; + color: 255 255 255 0; + visible: 0; + } + } + + part { + name: "sb_vbar"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + fixed: 1 1; + visible: 0; + min: 16 16; + align: 1.0 0.0; + rel1 { + relative: 1.0 0.0; + offset: -1 0; + } + rel2 { + relative: 1.0 1.0; + offset: -1 -1; + } + } + } + + part { + name: "elm.dragable.vbar"; + type: RECT; + clip_to: "sb_vbar_clip"; + mouse_events: 0; + dragable { + x: 0 0 0; + y: 1 1 0; + confine: "sb_vbar"; + } + description { + state: "default" 0.0; + color: 255 255 255 255; + color_class: "light"; + fixed: 1 1; + min: 16 16; + max: 16 99999; + rel1 { + relative: 0.5 0.5; + offset: 0 0; + to: "sb_vbar"; + } + rel2 { + relative: 0.5 0.5; + offset: 0 0; + to: "sb_vbar"; + } + } + } + } + + programs { + program { + signal: "load"; + source: ""; + script { + set_state(PART:"sb_vbar_clip", "hidden", 0.0); + set_int(sbvis_v, 0); + set_int(sbalways_v, 0); + set_int(sbvis_timer, 0); + } + } + + program { + name: "vbar_show"; + signal: "elm,action,show,vbar"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "sb_vbar_clip_master"; + } + + program { + name: "vbar_hide"; + signal: "elm,action,hide,vbar"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "sb_vbar_clip_master"; + } + + program { + name: "vbar_show_always"; + signal: "elm,action,show_always,vbar"; + source: "elm"; + script { + new v; + v = get_int(sbvis_v); + v |= get_int(sbalways_v); + if (!v) { + set_int(sbalways_v, 1); + emit("do-show-vbar", ""); + set_int(sbvis_v, 1); + } + } + } + + program { + name: "vbar_show_notalways"; + signal: "elm,action,show_notalways,vbar"; + source: "elm"; + script { + new v; + v = get_int(sbalways_v); + if (v) { + set_int(sbalways_v, 0); + v = get_int(sbvis_v); + if (!v) { + emit("do-hide-vbar", ""); + set_int(sbvis_v, 0); + } + } + } + } + + program { + signal: "do-show-vbar"; + source: ""; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.5; + target: "sb_vbar_clip"; + } + + program { + signal: "do-hide-vbar"; + source: ""; + action: STATE_SET "hidden" 0.0; + transition: LINEAR 0.5; + target: "sb_vbar_clip"; + } + + program { + name: "scroll"; + signal: "elm,action,scroll"; + source: "elm"; + script { + new v; + v = get_int(sbvis_v); + v |= get_int(sbalways_v); + if (!v) { + emit("do-show-vbar", ""); + set_int(sbvis_v, 1); + } + v = get_int(sbvis_timer); + if (v > 0) cancel_timer(v); + v = timer(1.0, "timer0", 0); + set_int(sbvis_timer, v); + } + } + } +} diff --git a/dialer/history.c b/dialer/history.c index 44a05ac..a843d8c 100644 --- a/dialer/history.c +++ b/dialer/history.c @@ -240,11 +240,9 @@ static char *_item_label_get(void *data, Evas_Object *obj __UNUSED__, part += strlen("text.call."); if (!strcmp(part, "name")) { - const char *name; - name = call_info->name; if (!call_info->name || call_info->name[0] == '\0') - name = call_info->line_id; - return strdup(name); + return phone_format(call_info->line_id); + return strdup(call_info->name); } if (!strcmp(part, "time")) @@ -336,9 +334,11 @@ Evas_Object *history_add(Evas_Object *parent) genlist_all = elm_genlist_add(obj); EINA_SAFETY_ON_NULL_GOTO(genlist_all, err_object_new); + elm_object_style_set(genlist_all, "history"); genlist_missed = elm_genlist_add(obj); EINA_SAFETY_ON_NULL_GOTO(genlist_missed, err_object_new); + elm_object_style_set(genlist_missed, "history"); itc = elm_genlist_item_class_new(); EINA_SAFETY_ON_NULL_GOTO(itc, err_object_new); -- 2.7.4