description {
state, "default" 0.0;
min, 378 294;
- color, 113 128 147 255;
- }
- description {
- state, "focus" 0.0;
- inherit, "default" 0.0;
- color, 0 119 246 255;
+ visible, 0;
}
}
part {
- name, "thumbnail";
- type, RECT;
+ name, PART_RECENT_THUMBNAIL_BG;
+ type, SWALLOW;
scale, 1;
description {
state, "default" 0.0;
min, 0 198;
fixed, 0 1;
align, 0.5 0.0;
- color, 132 147 166 255;
+ }
+ }
+ part {
+ name, PART_RECENT_TEXT_BG;
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ to, PART_RECENT_THUMBNAIL_BG;
+ relative, 0.0 1.0;
+ }
+ rel2.to, "bg";
+ fixed, 1 1;
+ visible, 1;
+ }
+ description {
+ state, "focus" 0.0;
+ inherit, "default" 0.0;
+ visible, 0;
+ }
+ }
+ part {
+ name, "text.bg";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1.to, PART_RECENT_TEXT_BG;
+ rel2.to, PART_RECENT_TEXT_BG;
+ fixed, 1 1;
+ color, 0 0 0 0;
+ }
+ description {
+ state, "focus" 0.0;
+ inherit, "default" 0.0;
+ color, 0 119 246 255;
}
}
part {
scale, 1;
description {
state, "default" 0.0;
- rel1.to, "thumbnail";
- rel2.to, "thumbnail";
+ rel1.to, PART_RECENT_THUMBNAIL_BG;
+ rel2.to, PART_RECENT_THUMBNAIL_BG;
min, 100 100;
fixed, 1 1;
}
scale, 1;
description {
state, "default" 0.0;
- rel1.to, "thumbnail";
+ rel1.to, PART_RECENT_THUMBNAIL_BG;
rel2 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 1.0 0.0;
}
min, 0 3;
relative, 0.0 1.0;
}
rel2 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 0.0 1.0;
}
min, 3 0;
to, "border.up";
relative, 1.0 1.0;
}
- rel2.to, "thumbnail";
+ rel2.to, PART_RECENT_THUMBNAIL_BG;
min, 3 0;
fixed, 1 0;
align, 1.0 0.5;
description {
state, "default" 0.0;
rel1 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 0.0 0.0;
}
rel2 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 0.0 0.0;
}
min, 4 4;
state, "default" 0.0;
min, 15 18;
rel1 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 0.0 1.0;
}
rel2 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 0.0 1.0;
}
fixed, 1 1;
state, "default" 0.0;
min, 15 18;
rel1 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 1.0 1.0;
}
rel2 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 1.0 1.0;
}
fixed, 1 1;
source, SRC_PROG;
action, STATE_SET "focus" 0.0;
transition, TRANSITION_DECEL;
- target, "bg";
+ target, "text.bg";
target, "border.up";
target, "border.right";
target, "border.left";
source, SRC_PROG;
action, STATE_SET "default" 0.0;
transition, TRANSITION_DECEL;
- target, "bg";
+ target, "text.bg";
target, "border.up";
target, "border.right";
target, "border.left";
description {
state, "default" 0.0;
min, 236 294;
- color, 113 128 147 255;
- }
- description {
- state, "focus" 0.0;
- inherit, "default" 0.0;
- color, 0 119 246 255;
+ visible, 0;
}
}
part {
- name, "thumbnail";
- type, RECT;
+ name, PART_RECENT_THUMBNAIL_BG;
+ type, SWALLOW;
scale, 1;
description {
state, "default" 0.0;
min, 0 198;
fixed, 0 1;
align, 0.5 0.0;
- color, 132 147 166 255;
+ }
+ }
+ part {
+ name, PART_RECENT_TEXT_BG;
+ type, SWALLOW;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1 {
+ to, PART_RECENT_THUMBNAIL_BG;
+ relative, 0.0 1.0;
+ }
+ rel2.to, "bg";
+ fixed, 1 1;
+ }
+ }
+ part {
+ name, "text.bg";
+ type, RECT;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ rel1.to, PART_RECENT_TEXT_BG;
+ rel2.to, PART_RECENT_TEXT_BG;
+ fixed, 1 1;
+ color, 0 0 0 0;
+ }
+ description {
+ state, "focus" 0.0;
+ inherit, "default" 0.0;
+ color, 0 119 246 255;
}
}
part {
description {
state, "default" 0.0;
rel1 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 0.5 0.5;
}
rel2 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 0.5 0.5;
}
min, 100 100;
scale, 1;
description {
state, "default" 0.0;
- rel1.to, "thumbnail";
+ rel1.to, PART_RECENT_THUMBNAIL_BG;
rel2 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 1.0 0.0;
}
min, 0 3;
relative, 0.0 1.0;
}
rel2 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 0.0 1.0;
}
min, 3 0;
to, "border.up";
relative, 1.0 1.0;
}
- rel2.to, "thumbnail";
+ rel2.to, PART_RECENT_THUMBNAIL_BG;
min, 3 0;
fixed, 1 0;
align, 1.0 0.5;
description {
state, "default" 0.0;
rel1 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 0.0 0.0;
}
rel2 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 0.0 0.0;
}
min, 4 4;
state, "default" 0.0;
min, 15 18;
rel1 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 0.0 1.0;
}
rel2 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 0.0 1.0;
}
fixed, 1 1;
state, "default" 0.0;
min, 15 18;
rel1 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 1.0 1.0;
}
rel2 {
- to, "thumbnail";
+ to, PART_RECENT_THUMBNAIL_BG;
relative, 1.0 1.0;
}
fixed, 1 1;
source, SRC_PROG;
action, STATE_SET "focus" 0.0;
transition, TRANSITION_DECEL;
- target, "bg";
+ target, "text.bg";
target, "border.up";
target, "border.right";
target, "border.left";
source, SRC_PROG;
action, STATE_SET "default" 0.0;
transition, TRANSITION_DECEL;
- target, "bg";
+ target, "text.bg";
target, "border.up";
target, "border.right";
target, "border.left";
}
style {
name, "recent_label_subtitle";
- base, "font=TizenSans font_size=20 color=#999999 align=left";
+ base, "font=TizenSans font_size=20 color=#cdcdcd align=left";
}
}
#define PART_RECENT_TITLE "part.recent.title"
#define PART_RECENT_SUBTITLE "part.recent.subtitle"
#define PART_RECENT_THUMBNAIL "part.recent.thumbnail"
+#define PART_RECENT_THUMBNAIL_BG "part.recent.thumbnail.bg"
+#define PART_RECENT_TEXT_BG "part.recent.text.bg"
#define PART_RECENT_ICON "part.recent.icon"
#define PART_RECENT_FAVORITE "part.recent.favorite"
#define PART_RECENT_DELETE "part.recent.delete"
Evas_Object *utils_add_entry(Evas_Object *base, char *text, bool password,
const char *part);
Evas_Object *utils_add_popup(Evas_Object *base, char *title, char *message);
+Evas_Object *utils_add_rectangle(Evas_Object *base, int r, int g, int b, int a);
bool utils_launch_app(const char *pkg, const char *key, const char *value);
#endif /* __AIR_HOME_UTILS_H__ */
return NULL;
}
- elm_image_file_set(ic, file, NULL);
+ if (!elm_image_file_set(ic, file, NULL)) {
+ _ERR("failed to set image file");
+ evas_object_del(ic);
+ return NULL;
+ }
if (part)
elm_object_part_content_set(base, part, ic);
return popup;
}
+Evas_Object *utils_add_rectangle(Evas_Object *base, int r, int g, int b, int a)
+{
+ Evas_Object *rect;
+
+ if (!base) {
+ _ERR("Invalid argument");
+ return NULL;
+ }
+
+ rect = evas_object_rectangle_add(evas_object_evas_get(base));
+ if (!rect) {
+ _ERR("failed to add rectangle");
+ return NULL;
+ }
+
+ evas_object_color_set(rect, r, g, b, a);
+
+ return rect;
+}
+
bool utils_launch_app(const char *pkg, const char *key, const char *value)
{
app_control_h app_control;
#include <app_debug.h>
#include <viewmgr.h>
#include <inputmgr.h>
+#include <app_contents.h>
#include "defs.h"
#include "view.h"
return base;
}
+static void _set_item_bg(struct color_data bg, Evas_Object *eo,
+ const char *part)
+{
+ Evas_Object *rect = utils_add_rectangle(eo, bg.r, bg.g, bg.b, bg.a);
+
+ if (!rect) {
+ _ERR("failed to set item bg");
+ return;
+ }
+
+ elm_object_part_content_set(eo, part, rect);
+}
+
static struct _bar_item *_pack_item(struct _priv *priv, Evas_Object *box,
struct datamgr_item *di)
{
Evas_Object *eo, *lbl, *sub_lbl, *thumb, *ic;
struct _bar_item *bi;
const char *group;
+ struct color_data bright_bg, dark_bg;
switch (di->type) {
case RECENT_ITEM_PREVIEW:
thumb = utils_add_icon(eo, di->icon, PART_RECENT_THUMBNAIL);
if (!thumb) {
_ERR("failed to add thumb");
- evas_object_del(eo);
- free(bi);
- return NULL;
+ thumb = utils_add_icon(eo, IMAGE_RECENT_THUMB_APP,
+ PART_RECENT_THUMBNAIL);
+ if (!thumb) {
+ evas_object_del(eo);
+ free(bi);
+ return NULL;
+ }
}
}
_ERR("failed to add sub title");
}
+ app_contents_get_color(di->title, &bright_bg, &dark_bg);
+ _set_item_bg(bright_bg, eo, PART_RECENT_THUMBNAIL_BG);
+ _set_item_bg(dark_bg, eo, PART_RECENT_TEXT_BG);
+
elm_object_focus_next_object_set(eo, priv->del_btn, ELM_FOCUS_UP);
inputmgr_add_callback(eo, INPUT_HANDLER_TYPE_EO, &handler, bi);
elm_box_pack_end(box, eo);