From 4322aa3aee8d6e133f16390a4ef2e4097c08651c Mon Sep 17 00:00:00 2001 From: Hyojung Jo Date: Fri, 7 Aug 2015 15:16:15 +0900 Subject: [PATCH] Applied the app_contetns_color_get API Change-Id: I67511504e3917f8a8d86d8ef4bb3abcb72dcc428 Signed-off-by: Hyojung Jo --- include/define.h | 4 +- res/favorite.edc | 39 ----- res/widgets/gengrid_apps.edc | 62 +++++--- res/widgets/gengrid_movie.edc | 131 +++++++--------- res/widgets/gengrid_tv.edc | 133 +++++++--------- res/widgets/gengrid_webs.edc | 356 +++++++++++++++++++++++++++++++++--------- src/grid/grid_apps.c | 100 +++--------- src/grid/grid_movie.c | 75 ++++++--- src/grid/grid_tv.c | 69 +++++--- src/grid/grid_webs.c | 55 +++---- 10 files changed, 598 insertions(+), 426 deletions(-) diff --git a/include/define.h b/include/define.h index ab5dca1..c376285 100644 --- a/include/define.h +++ b/include/define.h @@ -22,7 +22,6 @@ /* Group */ #define GRP_VIEW_BASE "grp.view.base" -#define GRP_APP_THUMB_BG "grp.app.thumb.bg" /* Part for edc file */ #define PART_TOP_TITLE "part.top.title" @@ -33,12 +32,11 @@ #define PART_CONTENTS_SUBCOUNT "part.contents.subcount" #define PART_COUNT_DIVIDE_LINE "part.count.divide.line" #define PART_THUMB_BG "part.thumb.bg" +#define PART_TEXT_BG "part.text.bg" #define PART_THUMB_ICON "part.thumb.icon" #define PART_THUMB_TEXT "part.thumb.text" #define PART_THUMB_SUBTEXT1 "part.thumb.subtext1" #define PART_THUMB_SUBTEXT2 "part.thumb.subtext2" -#define PART_THUMB_ICON_BG "part.thumb.icon.bg" -#define PART_THUMB_TEXT_BG "part.thumb.text.bg" #define PART_THUMB_PLAY_ICON "part.thumb.play.icon" #define PART_THUMB_DEFAULT_TV_ICON "part.thumb.default.tv.icon" diff --git a/res/favorite.edc b/res/favorite.edc index ead76fe..3875b1f 100644 --- a/res/favorite.edc +++ b/res/favorite.edc @@ -340,43 +340,4 @@ collections { } } } - - - group { - name, GRP_APP_THUMB_BG; - parts { - part { - name, PART_THUMB_ICON_BG; - type, SWALLOW; - scale, 1; - description { - state, "default" 0.0; - min, 212 212; - rel2.relative, 0.0 0.0; - align, 0.0 0.0; - fixed, 1 1; - } - } - - part { - name, PART_THUMB_TEXT_BG; - type, SWALLOW; - scale, 1; - description { - state, "default" 0.0; - min, 212 82; - rel1 { - to, PART_THUMB_ICON_BG; - relative, 0.0 1.0; - } - rel2 { - to, PART_THUMB_ICON_BG; - relative, 0.0 1.0; - } - align, 0.0 0.0; - fixed, 1 1; - } - } - } - } } diff --git a/res/widgets/gengrid_apps.edc b/res/widgets/gengrid_apps.edc index e35f858..bfa714a 100644 --- a/res/widgets/gengrid_apps.edc +++ b/res/widgets/gengrid_apps.edc @@ -18,7 +18,7 @@ group { name, "elm/gengrid/item/style.apps/default"; data.item, "focus_highlight" "on"; data.item, "texts" "part.thumb.text"; - data.item, "contents" "part.thumb.icon part.thumb.bg"; + data.item, "contents" "part.thumb.icon part.thumb.bg part.text.bg"; parts { part { name, "padding.bottom.right"; @@ -74,7 +74,13 @@ group { description { state, "default" 0.0; rel1.to, "part.bg"; - rel2.to, "part.bg"; + rel2 { + to, "part.bg"; + relative, 1.0 0.0; + } + min, 0 212; + align, 0.5 0.0; + fixed, 0 1; map { perspective_on, 1; perspective, "map"; @@ -88,16 +94,28 @@ group { } part { - name, "part.thumb.icon.bg"; - type, RECT; + name, PART_TEXT_BG; + type, SWALLOW; scale, 1; description { state, "default" 0.0; - min, 212 212; - rel2.relative, 0.0 0.0; - align, 0.0 0.0; - fixed, 1 1; - visible, 0; + rel1 { + to, PART_THUMB_BG; + relative, 0.0 1.0; + } + rel2.to, PART_THUMB_BG; + min, 0 82; + align, 0.5 0.0; + fixed, 0 1; + map { + perspective_on, 1; + perspective, "map"; + } + } + description { + state, "focused" 0.0; + inherit, "default" 0.0; + map.on, 1; } } @@ -109,11 +127,11 @@ group { state, "default" 0.0; min, SIZE_APP_ICON_MAX SIZE_APP_ICON_MAX; rel1 { - to, "part.thumb.icon.bg"; + to, PART_THUMB_BG; relative, 0.5 0.5; } rel2 { - to, "part.thumb.icon.bg"; + to, PART_THUMB_BG; relative, 0.5 0.5; } align, 0.5 0.5; @@ -136,13 +154,13 @@ group { scale, 1; description { state, "default" 0.0; - color, 0 119 246 255; - min, 0 3; + color, COLOR_ITEM_FOCUS; rel1.to, "part.bg"; rel2 { to, "part.bg"; relative, 1.0 0.0; } + min, 0 6; align, 0.5 0.0; fixed, 0 1; visible, 0; @@ -161,7 +179,7 @@ group { state, "focused_0" 0.0; inherit, "default" 0.0; visible, 1; - color, 0 119 246 0; + color, COLOR_ITEM_FOCUS_0; } } @@ -171,8 +189,7 @@ group { scale, 1; description { state, "default" 0.0; - color, 0 119 246 255; - min, 3 0; + color, COLOR_ITEM_FOCUS; rel1 { to, "part.focus.up"; relative, 0.0 1.0; @@ -181,6 +198,7 @@ group { to, "part.bg"; relative, 0.0 1.0; } + min, 6 0; align, 0.0 0.5; fixed, 1 0; visible, 0; @@ -199,7 +217,7 @@ group { state, "focused_0" 0.0; inherit, "default" 0.0; visible, 1; - color, 0 119 246 0; + color, COLOR_ITEM_FOCUS_0; } } @@ -209,13 +227,13 @@ group { scale, 1; description { state, "default" 0.0; - color, 0 119 246 255; - min, 3 0; + color, COLOR_ITEM_FOCUS; rel1 { to, "part.focus.up"; relative, 1.0 1.0; } rel2.to, "part.bg"; + min, 6 0; align, 1.0 0.5; fixed, 1 0; visible, 0; @@ -244,7 +262,7 @@ group { scale, 1; description { state, "default" 0.0; - color, 0 119 246 255; + color, COLOR_ITEM_FOCUS; min, 0 82; rel1 { to, "part.focus.left"; @@ -272,7 +290,7 @@ group { state, "focused_0" 0.0; inherit, "default" 0.0; visible, 1; - color, 0 119 246 0; + color, COLOR_ITEM_FOCUS_0; } } @@ -351,6 +369,7 @@ group { name, "focus.in.anim"; action, STATE_SET "focused" 0.0; target, PART_THUMB_BG; + target, PART_TEXT_BG; target, PART_THUMB_ICON; target, "part.focus.up"; target, "part.focus.left"; @@ -383,6 +402,7 @@ group { name, "focus.out.anim.2"; action, STATE_SET "default" 0.0; target, PART_THUMB_BG; + target, PART_TEXT_BG; target, PART_THUMB_ICON; target, "part.focus.up"; target, "part.focus.left"; diff --git a/res/widgets/gengrid_movie.edc b/res/widgets/gengrid_movie.edc index 2ff0ab4..bd5214b 100644 --- a/res/widgets/gengrid_movie.edc +++ b/res/widgets/gengrid_movie.edc @@ -19,7 +19,7 @@ group { data.item, "selectraise" "on"; data.item, "focus_highlight" "on"; data.item, "texts" "part.thumb.text"; - data.item, "contents" "part.thumb.icon"; + data.item, "contents" "part.thumb.icon part.thumb.bg part.text.bg"; images { image, PLAY_ICON_PNG COMP; } @@ -73,17 +73,19 @@ group { } part { - name, "part.default.bg"; - type, RECT; + name, PART_THUMB_BG; + type, SWALLOW; scale, 1; description { state, "default" 0.0; rel1.to, "part.bg"; rel2 { - to, "part.thumb.text.bg"; - relative, 1.0 1.0; + to, "part.bg"; + relative, 1.0 0.0; } - color, 0 0 0 115; + min, 0 212; + align, 0.5 0.0; + fixed, 0 1; map { perspective_on, 1; perspective, "map"; @@ -97,13 +99,19 @@ group { } part { - name, PART_THUMB_ICON; + name, PART_TEXT_BG; type, SWALLOW; scale, 1; description { state, "default" 0.0; - rel1.to, "part.default.bg"; - rel2.to, "part.default.bg"; + rel1 { + to, PART_THUMB_BG; + relative, 0.0 1.0; + } + rel2.to, PART_THUMB_BG; + min, 0 82; + align, 0.5 0.0; + fixed, 0 1; map { perspective_on, 1; perspective, "map"; @@ -117,15 +125,22 @@ group { } part { - name, "padding.play.icon"; - type, SPACER; + name, PART_THUMB_ICON; + type, SWALLOW; scale, 1; description { state, "default" 0.0; - min, 149 66; - rel2.relative, 0.0 0.0; - align, 0.0 0.0; - fixed, 1 1; + rel1.to, PART_THUMB_BG; + rel2.to, PART_THUMB_BG; + map { + perspective_on, 1; + perspective, "map"; + } + } + description { + state, "focused" 0.0; + inherit, "default" 0.0; + map.on, 1; } } @@ -138,14 +153,14 @@ group { min, 80 80; image.normal, PLAY_ICON_PNG; rel1 { - to, "padding.play.icon"; - relative, 1.0 1.0; + to, PART_THUMB_BG; + relative, 0.5 0.5; } rel2 { - to, "padding.play.icon"; - relative, 1.0 1.0; + to, PART_THUMB_BG; + relative, 0.5 0.5; } - align, 0.0 0.0; + align, 0.5 0.5; fixed, 1 1; map { perspective_on, 1; @@ -208,8 +223,8 @@ group { relative, 0.0 1.0; } rel2 { - to, "part.thumb.text.bg"; - relative, 0.0 0.0; + to, "part.bg"; + relative, 0.0 1.0; } min, 6 0; align, 0.0 0.5; @@ -246,10 +261,7 @@ group { to, "part.focus.up"; relative, 1.0 1.0; } - rel2 { - to, "part.thumb.text.bg"; - relative, 1.0 0.0; - } + rel2.to, "part.bg"; min, 6 0; align, 1.0 0.5; fixed, 1 0; @@ -274,21 +286,24 @@ group { } part { - name, "part.default.text.bg"; + name, "part.focus.down"; type, RECT; - mouse_events, 0; scale, 1; description { state, "default" 0.0; + color, COLOR_ITEM_FOCUS; + min, 0 82; rel1 { - to, "part.bg"; + to, "part.focus.left"; + relative, 1.0 1.0; + } + rel2 { + to, "part.focus.right"; relative, 0.0 1.0; } - rel2.to, "part.bg"; - min, 0 82; align, 0.5 1.0; - color, COLOR_TEXT_BG; fixed, 0 1; + visible, 0; map { perspective_on, 1; perspective, "map"; @@ -297,35 +312,13 @@ group { description { state, "focused" 0.0; inherit, "default" 0.0; - color, COLOR_ITEM_FOCUS; - map.on, 1; - } - } - - part { - name, "part.thumb.text.bg"; - type, RECT; - mouse_events, 0; - scale, 1; - description { - state, "default" 0.0; - color, COLOR_TEXT_BG; - rel1.to, "part.default.text.bg"; - rel2.to, "part.default.text.bg"; - map { - perspective_on, 1; - perspective, "map"; - } - } - description { - state, "focused" 0.0; - inherit, "default" 0.0; - color, COLOR_ITEM_FOCUS; map.on, 1; + visible, 1; } description { state, "focused_0" 0.0; inherit, "default" 0.0; + visible, 1; color, COLOR_ITEM_FOCUS_0; } } @@ -337,9 +330,9 @@ group { description { state, "default" 0.0; min, 18 0; - rel1.to, "part.thumb.text.bg"; + rel1.to, "part.focus.down"; rel2 { - to, "part.thumb.text.bg"; + to, "part.focus.down"; relative, 0.0 1.0; } align, 0.0 0.5; @@ -396,7 +389,7 @@ group { target, "part.focus.up"; target, "part.focus.left"; target, "part.focus.right"; - target, "part.thumb.text.bg"; + target, "part.focus.down"; target, PART_THUMB_TEXT; after, "focus.in.anim"; } @@ -404,21 +397,15 @@ group { program { name, "focus.in.anim"; action, STATE_SET "focused" 0.0; - target, "part.default.bg"; target, PART_THUMB_ICON; + target, PART_THUMB_BG; + target, PART_TEXT_BG; target, "part.play.icon"; target, "part.focus.up"; target, "part.focus.left"; target, "part.focus.right"; - target, "part.thumb.text.bg"; + target, "part.focus.down"; transition, TRANSITION_FOCUS; - after, "focus.in.anim.2"; - } - - program { - name, "focus.in.anim.2"; - action, STATE_SET "focused" 0.0; - target, "part.default.text.bg"; } program { @@ -427,7 +414,6 @@ group { source, "elm"; action, STATE_SET "default" 0.0; target, PART_THUMB_TEXT; - target, "part.default.text.bg"; after, "focus.out.anim"; } @@ -437,7 +423,7 @@ group { target, "part.focus.up"; target, "part.focus.left"; target, "part.focus.right"; - target, "part.thumb.text.bg"; + target, "part.focus.down"; transition, TRANSITION_FOCUS; after, "focus.out.anim.2"; } @@ -446,12 +432,13 @@ group { name, "focus.out.anim.2"; action, STATE_SET "default" 0.0; target, PART_THUMB_ICON; + target, PART_THUMB_BG; + target, PART_TEXT_BG; target, "part.play.icon"; - target, "part.default.bg"; target, "part.focus.up"; target, "part.focus.left"; target, "part.focus.right"; - target, "part.default.text.bg"; + target, "part.focus.down"; } program { diff --git a/res/widgets/gengrid_tv.edc b/res/widgets/gengrid_tv.edc index c39e7a1..a9f0526 100644 --- a/res/widgets/gengrid_tv.edc +++ b/res/widgets/gengrid_tv.edc @@ -19,7 +19,7 @@ group { data.item, "selectraise" "on"; data.item, "focus_highlight" "on"; data.item, "texts" "part.thumb.text"; - data.item, "contents" "part.thumb.icon part.thumb.default.tv.icon"; + data.item, "contents" "part.thumb.icon part.thumb.default.tv.icon part.thumb.bg part.text.bg"; parts { part { name, "padding.bottom.right"; @@ -69,17 +69,19 @@ group { } part { - name, "part.default.bg"; - type, RECT; + name, PART_THUMB_BG; + type, SWALLOW; scale, 1; description { state, "default" 0.0; rel1.to, "part.bg"; rel2 { - to, "part.thumb.text.bg"; - relative, 1.0 1.0; + to, "part.bg"; + relative, 1.0 0.0; } - color, 132 147 166 255; + min, 0 212; + align, 0.5 0.0; + fixed, 0 1; map { perspective_on, 1; perspective, "map"; @@ -93,13 +95,19 @@ group { } part { - name, PART_THUMB_ICON; + name, PART_TEXT_BG; type, SWALLOW; scale, 1; description { state, "default" 0.0; - rel1.to, "part.default.bg"; - rel2.to, "part.default.bg"; + rel1 { + to, PART_THUMB_BG; + relative, 0.0 1.0; + } + rel2.to, PART_THUMB_BG; + min, 0 82; + align, 0.5 0.0; + fixed, 0 1; map { perspective_on, 1; perspective, "map"; @@ -113,15 +121,22 @@ group { } part { - name, "padding.default.icon"; - type, SPACER; + name, PART_THUMB_ICON; + type, SWALLOW; scale, 1; description { state, "default" 0.0; - min, 139 56; - rel2.relative, 0.0 0.0; - align, 0.0 0.0; - fixed, 1 1; + rel1.to, PART_THUMB_BG; + rel2.to, PART_THUMB_BG; + map { + perspective_on, 1; + perspective, "map"; + } + } + description { + state, "focused" 0.0; + inherit, "default" 0.0; + map.on, 1; } } @@ -131,16 +146,16 @@ group { scale, 1; description { state, "default" 0.0; - min, 100 100; + min, SIZE_APP_ICON_MAX SIZE_APP_ICON_MAX; rel1 { - to, "padding.default.icon"; - relative, 1.0 1.0; + to, PART_THUMB_BG; + relative, 0.5 0.5; } rel2 { - to, "padding.default.icon"; - relative, 1.0 1.0; + to, PART_THUMB_BG; + relative, 0.5 0.5; } - align, 0.0 0.0; + align, 0.5 0.5; fixed, 1 1; map { perspective_on, 1; @@ -203,8 +218,8 @@ group { relative, 0.0 1.0; } rel2 { - to, "part.thumb.text.bg"; - relative, 0.0 0.0; + to, "part.bg"; + relative, 0.0 1.0; } min, 6 0; align, 0.0 0.5; @@ -241,10 +256,7 @@ group { to, "part.focus.up"; relative, 1.0 1.0; } - rel2 { - to, "part.thumb.text.bg"; - relative, 1.0 0.0; - } + rel2.to, "part.bg"; min, 6 0; align, 1.0 0.5; fixed, 1 0; @@ -269,21 +281,24 @@ group { } part { - name, "part.default.text.bg"; + name, "part.focus.down"; type, RECT; - mouse_events, 0; scale, 1; description { state, "default" 0.0; + color, COLOR_ITEM_FOCUS; + min, 0 82; rel1 { - to, "part.bg"; + to, "part.focus.left"; + relative, 1.0 1.0; + } + rel2 { + to, "part.focus.right"; relative, 0.0 1.0; } - rel2.to, "part.bg"; - min, 0 82; align, 0.5 1.0; - color, COLOR_TEXT_BG; fixed, 0 1; + visible, 0; map { perspective_on, 1; perspective, "map"; @@ -292,35 +307,13 @@ group { description { state, "focused" 0.0; inherit, "default" 0.0; - color, COLOR_ITEM_FOCUS; - map.on, 1; - } - } - - part { - name, "part.thumb.text.bg"; - type, RECT; - mouse_events, 0; - scale, 1; - description { - state, "default" 0.0; - color, COLOR_TEXT_BG; - rel1.to, "part.default.text.bg"; - rel2.to, "part.default.text.bg"; - map { - perspective_on, 1; - perspective, "map"; - } - } - description { - state, "focused" 0.0; - inherit, "default" 0.0; - color, COLOR_ITEM_FOCUS; map.on, 1; + visible, 1; } description { state, "focused_0" 0.0; inherit, "default" 0.0; + visible, 1; color, COLOR_ITEM_FOCUS_0; } } @@ -332,9 +325,9 @@ group { description { state, "default" 0.0; min, 18 0; - rel1.to, "part.thumb.text.bg"; + rel1.to, "part.focus.down"; rel2 { - to, "part.thumb.text.bg"; + to, "part.focus.down"; relative, 0.0 1.0; } align, 0.0 0.5; @@ -391,7 +384,7 @@ group { target, "part.focus.up"; target, "part.focus.left"; target, "part.focus.right"; - target, "part.thumb.text.bg"; + target, "part.focus.down"; target, PART_THUMB_TEXT; after, "focus.in.anim"; } @@ -399,21 +392,15 @@ group { program { name, "focus.in.anim"; action, STATE_SET "focused" 0.0; - target, "part.default.bg"; + target, PART_THUMB_BG; + target, PART_TEXT_BG; target, PART_THUMB_ICON; target, PART_THUMB_DEFAULT_TV_ICON; target, "part.focus.up"; target, "part.focus.left"; target, "part.focus.right"; - target, "part.thumb.text.bg"; + target, "part.focus.down"; transition, TRANSITION_FOCUS; - after, "focus.in.anim.2"; - } - - program { - name, "focus.in.anim.2"; - action, STATE_SET "focused" 0.0; - target, "part.default.text.bg"; } program { @@ -422,7 +409,6 @@ group { source, "elm"; action, STATE_SET "default" 0.0; target, PART_THUMB_TEXT; - target, "part.default.text.bg"; after, "focus.out.anim"; } @@ -432,7 +418,7 @@ group { target, "part.focus.up"; target, "part.focus.left"; target, "part.focus.right"; - target, "part.thumb.text.bg"; + target, "part.focus.down"; transition, TRANSITION_FOCUS; after, "focus.out.anim.2"; } @@ -442,11 +428,12 @@ group { action, STATE_SET "default" 0.0; target, PART_THUMB_ICON; target, PART_THUMB_DEFAULT_TV_ICON; - target, "part.default.bg"; + target, PART_THUMB_BG; + target, PART_TEXT_BG; target, "part.focus.up"; target, "part.focus.left"; target, "part.focus.right"; - target, "part.thumb.text.bg"; + target, "part.focus.down"; } program { diff --git a/res/widgets/gengrid_webs.edc b/res/widgets/gengrid_webs.edc index 754c1bb..09e1517 100644 --- a/res/widgets/gengrid_webs.edc +++ b/res/widgets/gengrid_webs.edc @@ -16,177 +16,332 @@ group { name, "elm/gengrid/item/style.webs/default"; + data.item, "selectraise" "on"; data.item, "focus_highlight" "on"; data.item, "texts" "part.thumb.text"; - data.item, "contents" "part.thumb.icon part.thumb.text.bg"; + data.item, "contents" "part.thumb.icon part.thumb.bg part.text.bg"; parts { part { - name, PART_THUMB_ICON; - type, SWALLOW; + name, "padding.bottom.right"; + type, SPACER; scale, 1; description { state, "default" 0.0; - min, 378 212; - rel2.relative, 0.0 0.0; - align, 0.0 0.0; + rel1.relative, 1.0 1.0; + min, 26 26; + align, 1.0 1.0; fixed, 1 1; } } part { - name, PART_THUMB_TEXT_BG; - type, SWALLOW; + name, "map"; + type, RECT; scale, 1; description { state, "default" 0.0; - min, 378 82; - rel1 { - to, PART_THUMB_ICON; - relative, 0.0 1.0; + perspective { + zplane, 0; + focal, 1000; } + visible, 0; + } + description { + state, "selected" 0.0; + inherit, "default" 0.0; + perspective.zplane, -100; + } + } + + part { + name, "part.bg"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; rel2 { - to, PART_THUMB_ICON; - relative, 0.0 1.0; + to, "padding.bottom.right"; + relative, 0.0 0.0; } - align, 0.0 0.0; fixed, 1 1; + visible, 0; } } part { - name, "part.focus.down"; - type, RECT; + name, PART_THUMB_BG; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + rel1.to, "part.bg"; + rel2 { + to, "part.bg"; + relative, 1.0 0.0; + } + min, 0 212; + align, 0.5 0.0; + fixed, 0 1; + map { + perspective_on, 1; + perspective, "map"; + } + } + description { + state, "focused" 0.0; + inherit, "default" 0.0; + map.on, 1; + } + } + + part { + name, PART_TEXT_BG; + type, SWALLOW; scale, 1; description { state, "default" 0.0; - color, 0 119 246 255; - min, 378 82; rel1 { - to, PART_THUMB_ICON; + to, PART_THUMB_BG; relative, 0.0 1.0; } - rel2 { - to, PART_THUMB_ICON; - relative, 0.0 1.0; + rel2.to, PART_THUMB_BG; + min, 0 82; + align, 0.5 0.0; + fixed, 0 1; + map { + perspective_on, 1; + perspective, "map"; } - align, 0.0 0.0; - fixed, 1 1; - visible, 0; } description { state, "focused" 0.0; inherit, "default" 0.0; - visible, 1; + map.on, 1; } } part { - name, "padding.thumb.text"; - type, SPACER; + name, PART_THUMB_ICON; + type, SWALLOW; scale, 1; description { state, "default" 0.0; - min, 18 0; - rel1.to, PART_THUMB_TEXT_BG; + rel1.to, PART_THUMB_BG; + rel2.to, PART_THUMB_BG; + map { + perspective_on, 1; + perspective, "map"; + } + } + description { + state, "focused" 0.0; + inherit, "default" 0.0; + map.on, 1; + } + } + + part { + name, "part.focus.up"; + type, RECT; + mouse_events, 0; + scale, 1; + description { + state, "default" 0.0; + color, COLOR_ITEM_FOCUS; + rel1.to, "part.bg"; rel2 { - to, PART_THUMB_TEXT_BG; - relative, 0.0 1.0; + to, "part.bg"; + relative, 1.0 0.0; } - align, 0.0 0.5; - fixed, 1 0; + min, 0 6; + align, 0.5 0.0; + fixed, 0 1; + visible, 0; + map { + perspective_on, 1; + perspective, "map"; + } + } + description { + state, "focused" 0.0; + inherit, "default" 0.0; + map.on, 1; + visible, 1; + } + description { + state, "focused_0" 0.0; + inherit, "default" 0.0; + visible, 1; + color, COLOR_ITEM_FOCUS_0; } } part { - name, PART_THUMB_TEXT; - type, TEXT; + name, "part.focus.left"; + type, RECT; + mouse_events, 0; scale, 1; description { state, "default" 0.0; - color, 255 255 255 255; - min, 342 82; + color, COLOR_ITEM_FOCUS; rel1 { - to, "padding.thumb.text"; - relative, 1.0 0.0; + to, "part.focus.up"; + relative, 0.0 1.0; } rel2 { - to, "padding.thumb.text"; - relative, 1.0 0.0; + to, "part.bg"; + relative, 0.0 1.0; } - align, 0.0 0.0; - fixed, 1 1; - text { - font, FONT_TIZENSANS_LIGHT; - size, 28; - align, 0.0 0.5; + min, 6 0; + align, 0.0 0.5; + fixed, 1 0; + visible, 0; + map { + perspective_on, 1; + perspective, "map"; } } + description { + state, "focused" 0.0; + inherit, "default" 0.0; + map.on, 1; + visible, 1; + } + description { + state, "focused_0" 0.0; + inherit, "default" 0.0; + visible, 1; + color, COLOR_ITEM_FOCUS_0; + } } part { - name, "part.focus.up"; + name, "part.focus.right"; type, RECT; + mouse_events, 0; scale, 1; description { state, "default" 0.0; - color, 0 119 246 255; - min, 378 6; - rel2.relative, 0.0 0.0; - align, 0.0 0.0; - fixed, 1 1; + color, COLOR_ITEM_FOCUS; + rel1 { + to, "part.focus.up"; + relative, 1.0 1.0; + } + rel2.to, "part.bg"; + min, 6 0; + align, 1.0 0.5; + fixed, 1 0; visible, 0; + map { + perspective_on, 1; + perspective, "map"; + } } description { state, "focused" 0.0; inherit, "default" 0.0; + map.on, 1; visible, 1; } + description { + state, "focused_0" 0.0; + inherit, "default" 0.0; + visible, 1; + color, COLOR_ITEM_FOCUS_0; + } } part { - name, "part.focus.left"; + name, "part.focus.down"; type, RECT; scale, 1; description { state, "default" 0.0; - color, 0 119 246 255; - min, 6 294; - rel2.relative, 0.0 0.0; - align, 0.0 0.0; - fixed, 1 1; + color, COLOR_ITEM_FOCUS; + min, 0 82; + rel1 { + to, "part.focus.left"; + relative, 1.0 1.0; + } + rel2 { + to, "part.focus.right"; + relative, 0.0 1.0; + } + align, 0.5 1.0; + fixed, 0 1; visible, 0; + map { + perspective_on, 1; + perspective, "map"; + } } description { state, "focused" 0.0; inherit, "default" 0.0; + map.on, 1; visible, 1; } + description { + state, "focused_0" 0.0; + inherit, "default" 0.0; + visible, 1; + color, COLOR_ITEM_FOCUS_0; + } } part { - name, "part.focus.right"; - type, RECT; + name, "padding.thumb.text"; + type, SPACER; scale, 1; description { state, "default" 0.0; - color, 0 119 246 255; - min, 6 294; + min, 18 0; + rel1.to, "part.focus.down"; + rel2 { + to, "part.focus.down"; + relative, 0.0 1.0; + } + align, 0.0 0.5; + fixed, 1 0; + } + } + + part { + name, PART_THUMB_TEXT; + type, TEXT; + scale, 1; + description { + state, "default" 0.0; + color, 255 255 255 255; + min, 342 82; rel1 { - to, "part.focus.up"; + to, "padding.thumb.text"; relative, 1.0 0.0; } rel2 { - to, "part.focus.up"; + to, "padding.thumb.text"; relative, 1.0 0.0; } - align, 1.0 0.0; + align, 0.0 0.0; fixed, 1 1; - visible, 0; + text { + font, FONT_TIZENSANS_LIGHT; + size, 28; + align, 0.0 0.5; + } + map { + perspective_on, 1; + perspective, "map"; + } } description { state, "focused" 0.0; inherit, "default" 0.0; - visible, 1; + map.on, 1; + } + description { + state, "focused_0" 0.0; + inherit, "focused" 0.0; } } } @@ -196,11 +351,26 @@ group { name, SIG_FOCUSED; signal, "elm,state,focused"; source, "elm"; - action, STATE_SET "focused" 0.0; + action, STATE_SET "focused_0" 0.0; target, "part.focus.up"; target, "part.focus.left"; + target, "part.focus.right"; target, "part.focus.down"; + target, PART_THUMB_TEXT; + after, "focus.in.anim"; + } + + program { + name, "focus.in.anim"; + action, STATE_SET "focused" 0.0; + target, PART_THUMB_ICON; + target, PART_THUMB_BG; + target, PART_TEXT_BG; + target, "part.focus.up"; + target, "part.focus.left"; target, "part.focus.right"; + target, "part.focus.down"; + transition, TRANSITION_FOCUS; } program { @@ -208,10 +378,54 @@ group { signal, "elm,state,unfocused"; source, "elm"; action, STATE_SET "default" 0.0; + target, PART_THUMB_TEXT; + after, "focus.out.anim"; + } + + program { + name, "focus.out.anim"; + action, STATE_SET "focused_0" 0.0; target, "part.focus.up"; target, "part.focus.left"; + target, "part.focus.right"; target, "part.focus.down"; + transition, TRANSITION_FOCUS; + after, "focus.out.anim.2"; + } + + program { + name, "focus.out.anim.2"; + action, STATE_SET "default" 0.0; + target, PART_THUMB_ICON; + target, PART_THUMB_BG; + target, PART_TEXT_BG; + target, "part.focus.up"; + target, "part.focus.left"; target, "part.focus.right"; + target, "part.focus.down"; + } + + program { + name, SIG_SELECTED; + signal, "elm,state,selected"; + source, "elm"; + action, STATE_SET "selected" 0.0; + target, "map"; + transition, TRANSITION_CLICK; + after, "after_selected"; + } + + program { + name, "after_selected"; + action, STATE_SET "default" 0.0; + target, "map"; + transition, TRANSITION_CLICK; + after, "item_selected"; + } + + program { + name, "item_selected"; + action, SIGNAL_EMIT SIG_ITEM_SELECTED SRC_EDC; } } } diff --git a/src/grid/grid_apps.c b/src/grid/grid_apps.c index 037bf7b..84c39f4 100644 --- a/src/grid/grid_apps.c +++ b/src/grid/grid_apps.c @@ -29,36 +29,6 @@ #define ITEM_APPS_X (212 + 26) #define ITEM_APPS_Y (294 + 26) -/* It is temporarily used. */ -#define COUNT_COLOR 7 - -struct color { - int r; - int g; - int b; - int a; -}; - -static struct color color_icon[] = { - {73, 155, 173, 255}, - {104, 99, 93, 255}, - {92, 122, 190, 255}, - {219, 162, 96, 255}, - {97, 109, 124, 255}, - {79, 187, 165, 255}, - {169, 54, 54, 255} -}; - -static struct color color_text[] = { - {55, 143, 162, 255}, - {93, 88, 82, 255}, - {75, 102, 163, 255}, - {194, 133, 62, 255}, - {86, 98, 113, 255}, - {47, 175, 149, 255}, - {155, 46, 46, 255} -}; - static char *_text_get(void *data, Evas_Object *obj, const char *part) { struct datamgr *dmgr; @@ -80,25 +50,13 @@ static char *_text_get(void *data, Evas_Object *obj, const char *part) return strdup(name); } -static int _get_color_index(const char *str) -{ - int i, value = 0; - - if (!str) - return 0; - - for (i = 0; i < strlen(str); i++) - value += *str; - - return value % COUNT_COLOR; -} - static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part) { struct datamgr *dmgr; - Evas_Object *img, *ly, *icon_bg, *text_bg = NULL; + Evas_Object *img, *rect = NULL; + struct color_data bright, dark; char *icon, *name, *img_path; - int idx, w, h; + int w, h; if (!data || !obj) { _ERR("Data is NULL."); @@ -135,44 +93,30 @@ static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part) } else if (!strcmp(part, PART_THUMB_BG)) { name = dmgr->get_data(data, DATA_NAME); - ly = elm_layout_add(obj); - if (!ly) { - _ERR("elm_bg_add failed."); - return NULL; - } - - elm_layout_file_set(ly, EDJEFILE, GRP_APP_THUMB_BG); - evas_object_show(ly); - - icon_bg = evas_object_rectangle_add(ly); - if (!icon_bg) { - _ERR("elm_rectangle_add failed."); - evas_object_del(ly); - return NULL; - } - - text_bg = evas_object_rectangle_add(icon_bg); - if (!text_bg) { - _ERR("elm_rectangle_add failed."); - evas_object_del(ly); - return NULL; - } + rect = evas_object_rectangle_add(obj); + if (!rect) { + _ERR("elm_rectangle_add failed."); + return NULL; + } - /* FIXME: The color will be changed as GUI later. */ - idx = _get_color_index(name); + app_contents_get_color(name, &bright, &dark); + evas_object_color_set(rect, bright.r, bright.g, + bright.b, bright.a); - evas_object_color_set(icon_bg, - color_icon[idx].r, color_icon[idx].g, - color_icon[idx].b, color_icon[idx].a); + return rect; + } else if (!strcmp(part, PART_TEXT_BG)) { + name = dmgr->get_data(data, DATA_NAME); - evas_object_color_set(text_bg, - color_text[idx].r, color_text[idx].g, - color_text[idx].b, color_text[idx].a); + rect = evas_object_rectangle_add(obj); + if (!rect) { + _ERR("elm_rectangle_add failed."); + return NULL; + } - elm_object_part_content_set(ly, PART_THUMB_ICON_BG, icon_bg); - elm_object_part_content_set(ly, PART_THUMB_TEXT_BG, text_bg); + app_contents_get_color(name, &bright, &dark); + evas_object_color_set(rect, dark.r, dark.g, dark.b, dark.a); - return ly; + return rect; } return NULL; diff --git a/src/grid/grid_movie.c b/src/grid/grid_movie.c index 80e5713..4c84b7d 100644 --- a/src/grid/grid_movie.c +++ b/src/grid/grid_movie.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "define.h" #include "grid.h" @@ -51,8 +52,9 @@ static char *_text_get(void *data, Evas_Object *obj, const char *part) static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part) { struct datamgr *dmgr; - Evas_Object *icon, *img; - char *thumbnail; + struct color_data bright, dark; + Evas_Object *icon, *img, *rect; + char *thumbnail, *name; if (!data || !obj) { _ERR("Invalid argument."); @@ -63,33 +65,64 @@ static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part) if (!dmgr || !dmgr->get_data) return NULL; - thumbnail = dmgr->get_data(data, DATA_THUMBNAIL); + if (!strcmp(part, PART_THUMB_ICON)) { + thumbnail = dmgr->get_data(data, DATA_THUMBNAIL); - if (!thumbnail) { - icon = elm_icon_add(obj); - if (!icon) { - _ERR("elm_icon_add failed."); + if (!thumbnail) { + icon = elm_icon_add(obj); + if (!icon) { + _ERR("elm_icon_add failed."); + return NULL; + } + + elm_icon_thumb_set(icon, + dmgr->get_data(data, DATA_PATH), NULL); + elm_image_aspect_fixed_set(icon, EINA_FALSE); + + return icon; + } + + img = elm_image_add(obj); + if (!img) { + _ERR("elm_image_add failed."); return NULL; } - elm_icon_thumb_set(icon, - dmgr->get_data(data, DATA_PATH), NULL); - elm_image_aspect_fixed_set(icon, EINA_FALSE); + elm_image_file_set(img, thumbnail, NULL); + elm_image_aspect_fixed_set(img, EINA_FALSE); + evas_object_show(img); - return icon; - } + return img; + } else if (!strcmp(part, PART_THUMB_BG)) { + name = dmgr->get_data(data, DATA_NAME); - img = elm_image_add(obj); - if (!img) { - _ERR("elm_image_add failed."); - return NULL; - } + rect = evas_object_rectangle_add(obj); + if (!rect) { + _ERR("elm_rectangle_add failed."); + return NULL; + } + + app_contents_get_color(name, &bright, &dark); + evas_object_color_set(rect, bright.r, bright.g, + bright.b, bright.a); + + return rect; + } else if (!strcmp(part, PART_TEXT_BG)) { + name = dmgr->get_data(data, DATA_NAME); + + rect = evas_object_rectangle_add(obj); + if (!rect) { + _ERR("elm_rectangle_add failed."); + return NULL; + } - elm_image_file_set(img, thumbnail, NULL); - elm_image_aspect_fixed_set(img, EINA_FALSE); - evas_object_show(img); + app_contents_get_color(name, &bright, &dark); + evas_object_color_set(rect, dark.r, dark.g, dark.b, dark.a); + + return rect; + } - return img; + return NULL; } static struct grid_class _gclass = { diff --git a/src/grid/grid_tv.c b/src/grid/grid_tv.c index 4594842..00367cf 100644 --- a/src/grid/grid_tv.c +++ b/src/grid/grid_tv.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "define.h" #include "grid.h" @@ -51,8 +52,9 @@ static char *_text_get(void *data, Evas_Object *obj, const char *part) static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part) { struct datamgr *dmgr; - Evas_Object *img; - char *thumbnail; + Evas_Object *img, *rect; + struct color_data bright, dark; + char *thumbnail, *name; if (!data || !obj) { _ERR("Invalid argument."); @@ -63,24 +65,55 @@ static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part) if (!dmgr || !dmgr->get_data) return NULL; - thumbnail = dmgr->get_data(data, DATA_THUMBNAIL); - - img = elm_image_add(obj); - if (!img) { - _ERR("elm_image_add failed."); - return NULL; + if (!strcmp(part, PART_THUMB_ICON)) { + thumbnail = dmgr->get_data(data, DATA_THUMBNAIL); + + img = elm_image_add(obj); + if (!img) { + _ERR("elm_image_add failed."); + return NULL; + } + elm_image_aspect_fixed_set(img, EINA_FALSE); + evas_object_show(img); + + if (!strcmp(part, PART_THUMB_ICON) && thumbnail) + elm_image_file_set(img, thumbnail, NULL); + else if (!strcmp(part, PART_THUMB_DEFAULT_TV_ICON) && !thumbnail) + elm_image_file_set(img, DEFAULT_TV_PNG, NULL); + else + img = NULL; + + return img; + } else if (!strcmp(part, PART_THUMB_BG)) { + name = dmgr->get_data(data, DATA_NAME); + + rect = evas_object_rectangle_add(obj); + if (!rect) { + _ERR("elm_rectangle_add failed."); + return NULL; + } + + app_contents_get_color(name, &bright, &dark); + evas_object_color_set(rect, bright.r, bright.g, + bright.b, bright.a); + + return rect; + } else if (!strcmp(part, PART_TEXT_BG)) { + name = dmgr->get_data(data, DATA_NAME); + + rect = evas_object_rectangle_add(obj); + if (!rect) { + _ERR("elm_rectangle_add failed."); + return NULL; + } + + app_contents_get_color(name, &bright, &dark); + evas_object_color_set(rect, dark.r, dark.g, dark.b, dark.a); + + return rect; } - elm_image_aspect_fixed_set(img, EINA_FALSE); - evas_object_show(img); - - if (!strcmp(part, PART_THUMB_ICON) && thumbnail) - elm_image_file_set(img, thumbnail, NULL); - else if (!strcmp(part, PART_THUMB_DEFAULT_TV_ICON) && !thumbnail) - elm_image_file_set(img, DEFAULT_TV_PNG, NULL); - else - img = NULL; - return img; + return NULL; } static struct grid_class _gclass = { diff --git a/src/grid/grid_webs.c b/src/grid/grid_webs.c index 5ee5ed6..a36998e 100644 --- a/src/grid/grid_webs.c +++ b/src/grid/grid_webs.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "define.h" #include "grid.h" @@ -27,24 +28,6 @@ #define ITEM_WEBS_X (378 + 26) #define ITEM_WEBS_Y (294 + 26) -/* It is temporarily used. */ -#define COUNT_COLOR 5 - -struct color { - int r; - int g; - int b; - int a; -}; - -static struct color colors[] = { - {73, 68, 62, 255}, - {55, 74, 97, 255}, - {75, 102, 163, 255}, - {55, 143, 162, 255}, - {86, 98, 113, 255} -}; - static char *_text_get(void *data, Evas_Object *obj, const char *part) { struct datamgr *dmgr; @@ -69,9 +52,9 @@ static char *_text_get(void *data, Evas_Object *obj, const char *part) static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part) { struct datamgr *dmgr; - Evas_Object *img = NULL, *text_bg; - char *snapshot; - int idx; + struct color_data bright, dark; + Evas_Object *img, *rect; + char *snapshot, *name; if (!data || !obj) { _ERR("Data is NULL."); @@ -100,21 +83,33 @@ static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part) evas_object_show(img); return img; - } else if (!strcmp(part, PART_THUMB_TEXT_BG)) { - text_bg = evas_object_rectangle_add(obj); - if (!text_bg) { - _ERR("evas_object_rectangle_add failed."); + } else if (!strcmp(part, PART_THUMB_BG)) { + name = dmgr->get_data(data, DATA_NAME); + + rect = evas_object_rectangle_add(obj); + if (!rect) { + _ERR("elm_rectangle_add failed."); return NULL; } - idx = rand() % COUNT_COLOR; + app_contents_get_color(name, &bright, &dark); + evas_object_color_set(rect, bright.r, bright.g, + bright.b, bright.a); + + return rect; + } else if (!strcmp(part, PART_TEXT_BG)) { + name = dmgr->get_data(data, DATA_NAME); - evas_object_color_set(text_bg, colors[idx].r, colors[idx].g, - colors[idx].b, colors[idx].a); + rect = evas_object_rectangle_add(obj); + if (!rect) { + _ERR("elm_rectangle_add failed."); + return NULL; + } - evas_object_show(text_bg); + app_contents_get_color(name, &bright, &dark); + evas_object_color_set(rect, dark.r, dark.g, dark.b, dark.a); - return text_bg; + return rect; } return NULL; -- 2.7.4