/* Group for EDC */
#define GRP_VIEW_BASE "grp.view.base"
#define GRP_VIEW_ACTION_MENU "grp.view.action.menu"
+#define GRP_APP_THUMB_BG "grp.app.thumb.bg"
/* Part for EDC */
#define PART_TOP_TITLE "part.top.title"
#define PART_APP_COUNT "part.app.count"
#define PART_NO_CONTENTS "part.no.contents"
#define PART_FAVORITE_ICON "part.favorite.icon"
+#define PART_THUMB_BG "part.thumb.bg"
+#define PART_THUMB_ICON "part.thumb.icon"
+#define PART_THUMB_ICON_BG "part.thumb.icon.bg"
+#define PART_THUMB_TEXT_BG "part.thumb.text.bg"
/* Style */
#define STYLE_MENU_BTN "style.menu.button"
name, "elm/gengrid/item/style.app/default";
data.item, "focus_highlight" "on";
data.item, "texts" "elm.text";
- data.item, "contents" "elm.swallow.icon";
+ data.item, "contents" "part.thumb.icon part.thumb.bg";
images {
image, FAVORITE_ICON_PNG COMP;
}
}
part {
- name, "bg";
- type, RECT;
+ name, PART_THUMB_BG;
+ type, SWALLOW;
scale, 1;
description {
state, "default" 0.0;
- color, 255 255 255 255;
min, 212 294;
rel2 {
to, "padding.bottom.right";
}
part {
- name, "text.bg";
+ name, "part.focus.text";
type, RECT;
scale, 1;
description {
state, "default" 0.0;
- /* FIXME: The color is temporarily defined. */
- color, 113 128 147 100;
+ color, 0 119 246 255;
min, 212 82;
rel1.to, "padding.bottom.right";
rel2 {
}
align, 1.0 1.0;
fixed, 1 1;
+ visible, 0;
}
description {
state, "focused" 0.0;
inherit, "default" 0.0;
- color, 0 119 246 255;
+ visible, 1;
}
}
description {
state, "default" 0.0;
min, 18 0;
- rel1.to, "text.bg";
+ rel1.to, "part.focus.text";
rel2 {
- to, "text.bg";
+ to, "part.focus.text";
relative, 0.0 1.0;
}
align, 0.0 0.5;
}
part {
- name, "elm.swallow.icon";
+ name, PART_THUMB_ICON;
type, SWALLOW;
scale, 1;
description {
target, "part.focus.left";
target, "part.focus.down";
target, "part.focus.right";
- target, "text.bg";
+ target, "part.focus.text";
after, "item_focused";
}
target, "part.focus.left";
target, "part.focus.down";
target, "part.focus.right";
- target, "text.bg";
+ target, "part.focus.text";
}
program {
#include "define.h"
#include "data/app.h"
+/* It is temporarily used. */
+#define COUNT_COLOR 7
+
+struct color {
+ int r;
+ int g;
+ int b;
+ int a;
+};
+
+static struct color color_icon[] = {
+ {84, 79, 73, 255},
+ {92, 122, 190, 255},
+ {73, 155, 173, 255},
+ {79, 187, 165, 255},
+ {97, 109, 124, 255},
+ {169, 54, 54, 255},
+ {206, 118, 70, 255}
+};
+
+static struct color color_text[] =
+{
+ {73, 68, 62, 255},
+ {75, 102, 163, 255},
+ {55, 143, 162, 255},
+ {47, 175, 149, 255},
+ {86, 98, 113, 255},
+ {155, 46, 46, 255},
+ {200, 99, 45, 255}
+};
+
static char *_text_get(void *data, Evas_Object *obj, const char *part)
{
struct app_data *adata;
static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part)
{
struct app_data *adata;
- Evas_Object *img;
+ Evas_Object *img, *ly, *icon_bg, *text_bg;
char *icon;
+ int idx;
if (!data || !obj) {
_ERR("Invalid argument.");
}
adata = data;
- icon = get_app_icon(adata);
+ if (!strcmp(part, PART_THUMB_ICON)) {
+ icon = get_app_icon(adata);
- img = elm_image_add(obj);
- if (!img) {
- _ERR("elm_image_add failed.");
- return NULL;
- }
+ img = elm_image_add(obj);
+ if (!img) {
+ _ERR("elm_image_add failed.");
+ return NULL;
+ }
- if (!icon || !strcmp(icon, STR_NULL))
- /* FIXME: The default icon image should be registerd. */
- elm_image_file_set(img, NULL, NULL);
- else
- elm_image_file_set(img, icon, NULL);
+ if (!icon || !strcmp(icon, STR_NULL))
+ /* FIXME: The default icon image should be registerd. */
+ elm_image_file_set(img, NULL, NULL);
+ else
+ elm_image_file_set(img, icon, NULL);
+
+ return img;
+ } else if (!strcmp(part, PART_THUMB_BG)) {
+ 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;;
+ }
+
+ /* FIXME: The color will be changed as GUI later. */
+ idx = rand() % COUNT_COLOR;
+
+ evas_object_color_set(icon_bg,
+ color_icon[idx].r, color_icon[idx].g,
+ color_icon[idx].b, color_icon[idx].a);
+
+ evas_object_color_set(text_bg,
+ color_text[idx].r, color_text[idx].g,
+ color_text[idx].b, color_text[idx].a);
+
+ elm_object_part_content_set(ly, PART_THUMB_ICON_BG, icon_bg);
+ elm_object_part_content_set(ly, PART_THUMB_TEXT_BG, text_bg);
+
+ return ly;
+ }
- return img;
+ return NULL;
}
static struct grid_class _gclass = {