set photo icon mask 57/44257/1
authorSoohye Shin <soohye.shin@samsung.com>
Mon, 20 Jul 2015 08:18:50 +0000 (17:18 +0900)
committerSoohye Shin <soohye.shin@samsung.com>
Mon, 20 Jul 2015 08:18:50 +0000 (17:18 +0900)
Change-Id: Icd7897ad075f29752be8dbdd797b8bd2cee97a4d
Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
edje/images/mask_user_nor.png [new file with mode: 0644]
edje/view/baritem.edc
include/defs.h
src/data/data_user.c
src/view/view_user.c

diff --git a/edje/images/mask_user_nor.png b/edje/images/mask_user_nor.png
new file mode 100644 (file)
index 0000000..f8045fe
Binary files /dev/null and b/edje/images/mask_user_nor.png differ
index f8dcf4d..400f4cf 100644 (file)
 #include "../../include/defs.h"
 group {
        name, GRP_BAR_ITEM;
+       images {
+               image, "mask_user_nor.png" COMP;
+       }
+       script {
+               public mask_on;
+       }
        parts {
                part {
                        name, "bg";
@@ -101,6 +107,42 @@ group {
                                rel2.to, PART_BAR_ITEM_ICON;
                        }
                }
+               part {
+                       name, "mask";
+                       type, IMAGE;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1.to, PART_BAR_ITEM_ICON;
+                               rel2.to, PART_BAR_ITEM_ICON;
+                               image.normal, "mask_user_nor.png";
+                               visible, 0;
+                       }
+                       description {
+                               state, "show" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 1;
+                       }
+               }
+               part {
+                       name, "mask_focus";
+                       type, IMAGE;
+                       scale, 1;
+                       clip_to, "clip";
+                       description {
+                               state, "default" 0.0;
+                               image.normal, "mask_user_nor.png";
+                               color, 0 119 245 255;
+                               rel1.to, PART_BAR_ITEM_ICON;
+                               rel2.to, PART_BAR_ITEM_ICON;
+                               visible, 0;
+                       }
+                       description {
+                               state, "show" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 1;
+                       }
+               }
        }
        programs {
                program {
@@ -175,5 +217,29 @@ group {
                        target, "clip";
                        after, "sig,focus";
                }
+               program {
+                       name, "sig,show,mask";
+                       signal, SIG_SHOW_MASK;
+                       source, SRC_PROG;
+                       script {
+                               set_int(mask_on, 1);
+                       }
+                       after, "sig,show,mask,after";
+               }
+               program {
+                       name, "sig,show,mask,after";
+                       source, SRC_PROG;
+                       action, STATE_SET "show" 0.0;
+                       target, "mask";
+               }
+               program {
+                       name, "sig,focus,mask";
+                       signal, SIG_FOCUS;
+                       source, SRC_PROG;
+                       script {
+                               if (get_int(mask_on) == 1)
+                                       set_state(PART:"mask_focus", "show", 0.0);
+                       }
+               }
        }
 }
index 7011a4e..6ad147d 100644 (file)
 #define SIG_HIDE_RECENT "sig.hide.recent"
 #define SIG_HIDE_RECENT_DONE "sig.hide.recent.done"
 #define SIG_DISABLE "sig.disable"
+#define SIG_SHOW_MASK "sig.show.mask"
 
 #define TITLE_WIDTH "title.width"
 
index 0e843fc..2379e5e 100644 (file)
@@ -29,6 +29,7 @@
 #include "data_user.h"
 #include "datamgr.h"
 #include "defs.h"
+#include "utils.h"
 
 #define GUM_ATTR_NAME "username"
 #define GUM_ATTR_USERTYPE "usertype"
@@ -272,7 +273,9 @@ static bool _load_login_user(Eina_List **list)
        icon = NULL;
        g_object_get(G_OBJECT(user), GUM_ATTR_NAME, &name, GUM_ATTR_ICON, &icon,
                        GUM_ATTR_USERTYPE, &type, NULL);
-       di = _pack_user(name, icon, icon, ITEM_SELECT_ACTION_POP, NULL, type);
+       di = _pack_user(name, icon,
+                       (char *)utils_get_focus_icon_from_icon(icon),
+                       ITEM_SELECT_ACTION_POP, NULL, type);
        if (!di) {
                g_object_unref(user);
                return false;
@@ -352,8 +355,9 @@ static bool _load_users(Eina_List **list)
                if (uid == user_uid)
                        continue;
 
-               di = _pack_user(name, icon, icon, ITEM_SELECT_ACTION_SWITCH,
-                               NULL, type);
+               di = _pack_user(name, icon,
+                               (char *)utils_get_focus_icon_from_icon(icon),
+                               ITEM_SELECT_ACTION_SWITCH, NULL, type);
                if (!di)
                        continue;
 
index 8d4cbb6..cdbe5d1 100644 (file)
@@ -283,12 +283,14 @@ static struct _bar_item *_pack_bar_item(struct _priv *priv, Evas_Object *box,
        if (!ic)
                goto err;
 
-       focus_ic = utils_add_icon(eo,
-                       utils_get_focus_icon_from_icon(di->focus_icon),
+       focus_ic = utils_add_icon(eo, di->focus_icon,
                        PART_BAR_ITEM_ICON_FOCUS);
        if (!focus_ic)
                goto err;
 
+       if (!strcmp(di->icon, di->focus_icon))
+               elm_object_signal_emit(eo, SIG_SHOW_MASK, SRC_PROG);
+
        bg = utils_add_bg(eo, COLOR_DEFAULT_R, COLOR_DEFAULT_G, COLOR_DEFAULT_B,
                        COLOR_DEFAULT_A, PART_BAR_ITEM_BG);
        if (!bg)