add user's popup for login, deleting and editing 86/34486/2
authorSoohye Shin <soohye.shin@samsung.com>
Wed, 28 Jan 2015 08:11:19 +0000 (17:11 +0900)
committerSoohye Shin <soohye.shin@samsung.com>
Wed, 28 Jan 2015 08:19:08 +0000 (17:19 +0900)
Change-Id: Id3f4d08d735bbcf757f4c1f67049ced2a080d4d9
Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
edje/bar/ubar.edc
edje/images/ico_bg_98.png [new file with mode: 0644]
edje/widget/ctxpopup.edc
edje/widget/label.edc
edje/widget/popup.edc
include/defs.h
include/engine.h
src/engine.c
src/hbar.c
src/homescreen.c
src/ubar.c

index cc61672..e636df0 100644 (file)
@@ -18,6 +18,7 @@
 
 group {
        name, GRP_USER;
+       data.item, DATA_TITLE_WIDTH "114";
        parts {
                part {
                        name, "area";
@@ -522,7 +523,7 @@ group {
                                }
                                min, 0 5;
                                align, 0.0 0.0;
-                               fixed, 0 0;
+                               fixed, 0 1;
                                visible, 0;
                        }
                }
@@ -674,6 +675,7 @@ group {
 
 group {
        name, GRP_UBAR_ITEM;
+       data.item, DATA_TITLE_WIDTH "98";
        parts {
                part {
                        name, PART_BG;
@@ -807,7 +809,7 @@ group {
                                }
                                min, 8 8;
                                align, 1.0 0.0;
-                               fixed, 0 0;
+                               fixed, 1 1;
                                visible, 0;
                        }
                }
@@ -1039,17 +1041,18 @@ group {
                        scale, 1;
                        description {
                                state, "default" 0.0;
-                               min, 0 82;
+                               min, 0 40;
                                fixed, 1 1;
                                rel1 {
-                                       to, "area";
-                                       relative, 0.5 1.0;
+                                       to, PART_POPUP_USER;
+                                       relative, 0.0 1.0;
                                }
                                rel2 {
-                                       to, "area";
-                                       relative, 0.5 1.0;
+                                       to, PART_POPUP_USER;
+                                       relative, 0.0 1.0;
                                }
-                               align, 0.5 1.0;
+                               align, 0.0 0.0;
+                               visible, 0;
                        }
                }
                part {
@@ -1058,42 +1061,202 @@ group {
                        scale, 1;
                        description {
                                state, "default" 0.0;
-                               min, 456 59;
+                               min, 327 59;
                                fixed, 1 1;
-                               rel1.to, "pad.entry";
-                               rel2 {
+                               align, 0.0 0.0;
+                               rel1 {
                                        to, "pad.entry";
-                                       relative, 0.0 0.0;
+                                       relative, 1.0 1.0;
                                }
+                               rel2.to, "pad.entry";
                                color, 27 32 45 40;
                        }
                }
                part {
-                       name, "bg.entry.border";
+                       name, "padding.border";
                        type, RECT;
                        scale, 1;
                        description {
                                state, "default" 0.0;
-                               min, 452 55;
+                               min, 2 2;
                                fixed, 1 1;
-                               rel1.to, "pad.entry";
+                               align, 0.0 0.0;
+                               rel1.to, "bg.entry";
                                rel2 {
-                                       to, "pad.entry";
+                                       to, "bg.entry";
                                        relative, 0.0 0.0;
                                }
+                               visible, 0;
+                       }
+               }
+               part {
+                       name, "bg.entry.border";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 323 55;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1 {
+                                       to, "padding.border";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2 {
+                                       to, "padding.border";
+                                       relative, 1.0 1.0;
+                               }
+                       }
+               }
+               part {
+                       name, PART_POPUP_ENTRY_NAME_DESC;
+                       type, TEXT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               fixed, 1 1;
+                               rel1.to, "bg.entry.border";
+                               rel2.to, "bg.entry.border";
+                               text {
+                                       font, "TizenSans";
+                                       size, 22;
+                                       align, 0.5 0.5;
+                               }
+                               color, 27 32 45 100;
+                               visible, 1;
+                       }
+                       description {
+                               state, "hide" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 0;
                        }
                }
                part {
-                       name, PART_POPUP_ENTRY;
+                       name, PART_POPUP_ENTRY_NAME;
                        type, SWALLOW;
                        scale, 1;
                        description {
                                state, "default" 0.0;
-                               fixed, 0 0;
+                               fixed, 1 1;
                                rel1.to, "bg.entry.border";
                                rel2.to, "bg.entry.border";
                        }
                }
+               part {
+                       name, "padding.pw";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 35 0;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1 {
+                                       to, "bg.entry";
+                                       relative, 1.0 0.0;
+                               }
+                               rel2 {
+                                       to, "bg.entry";
+                                       relative, 1.0 0.0;
+                               }
+                       }
+               }
+               part {
+                       name, "bg.pw.entry";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 327 59;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1 {
+                                       to, "padding.pw";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2.to, "padding.pw";
+                               color, 27 32 45 40;
+                       }
+                       description {
+                               state, "focus" 0.0;
+                               inherit, "default" 0.0;
+                               color, 69 143 255 255;
+                       }
+               }
+               part {
+                       name, "padding.pw.border";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 2 2;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1.to, "bg.pw.entry";
+                               rel2 {
+                                       to, "bg.pw.entry";
+                                       relative, 0.0 0.0;
+                               }
+                               visible, 0;
+                       }
+               }
+               part {
+                       name, "bg.pw.entry.border";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 323 55;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1 {
+                                       to, "padding.pw.border";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2.to, "padding.pw.border";
+                       }
+               }
+               part {
+                       name, PART_POPUP_ENTRY_PW_DESC;
+                       type, TEXT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               fixed, 1 1;
+                               rel1.to, "bg.pw.entry.border";
+                               rel2.to, "bg.pw.entry.border";
+                               text {
+                                       font, "TizenSans";
+                                       size, 22;
+                                       align, 0.5 0.5;
+                               }
+                               color, 27 32 45 100;
+                               visible, 1;
+                       }
+                       description {
+                               state, "hide" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 0;
+                       }
+                       description {
+                               state, "wrongpw" 0.0;
+                               inherit, "default" 0.0;
+                               color, 220 0 0 255;
+                               visible, 1;
+                       }
+               }
+               part {
+                       name, PART_POPUP_ENTRY_PW;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               fixed, 1 1;
+                               rel1.to, PART_POPUP_ENTRY_PW_DESC;
+                               rel2.to, PART_POPUP_ENTRY_PW_DESC;
+                       }
+               }
+
        }
 }
 
@@ -1121,6 +1284,7 @@ group {
                                state, "default" 0.0;
                                rel1.to, "area";
                                rel2.to, "area";
+                               fixed, 1 1;
                                image.normal, "ico_arrow_left.png";
                                visible, 0;
                        }
@@ -1173,6 +1337,7 @@ group {
                                state, "default" 0.0;
                                rel1.to, "area";
                                rel2.to, "area";
+                               fixed, 1 1;
                                image.normal, "ico_arrow_right.png";
                                visible, 0;
                        }
@@ -1200,3 +1365,468 @@ group {
                }
        }
 }
+
+group {
+       name, GRP_UBAR_LOGIN;
+       images {
+               image, "ico_bg_98.png" COMP;
+       }
+       parts {
+               part {
+                       name, "area";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               fixed, 1 1;
+                               visible, 0;
+                       }
+               }
+               part {
+                       name, "padding.profile";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 100 30;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1.to, "area";
+                               rel2 {
+                                       to, "area";
+                                       relative, 0.0 0.0;
+                               }
+                               visible, 0;
+                       }
+               }
+               part {
+                       name, "thumb.bg";
+                       type, IMAGE;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 120 120;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1 {
+                                       to, "padding.profile";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2 {
+                                       to, "padding.profile";
+                                       relative, 1.0 1.0;
+                               }
+                               image.normal, "ico_bg_98.png";
+                               color, 27 32 45 40;
+                       }
+               }
+               part {
+                       name, PART_USER_LOGIN_THUMB;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 120 120;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1.to, "thumb.bg";
+                               rel2.to, "thumb.bg";
+                       }
+               }
+               part {
+                       name, "padding.name";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 50 0;
+                               fixed, 1 0;
+                               align, 0.0 0.0;
+                               rel1 {
+                                       to, PART_USER_LOGIN_THUMB;
+                                       relative, 1.0 0.0;
+                               }
+                               rel2 {
+                                       to, PART_USER_LOGIN_THUMB;
+                                       relative, 1.0 1.0;
+                               }
+                               visible, 0;
+                       }
+               }
+               part {
+                       name, PART_USER_LOGIN_NAME;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 310 50;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1 {
+                                       to, "padding.name";
+                                       relative, 1.0 0.0;
+                               }
+                               rel2 {
+                                       to, "padding.name";
+                                       relative, 1.0 0.0;
+                               }
+                       }
+               }
+               part {
+                       name, "bg.entry";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 310 50;
+                               fixed, 1 1;
+                               align, 0.0 1.0;
+                               rel1 {
+                                       to, "padding.name";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2 {
+                                       to, "padding.name";
+                                       relative, 1.0 1.0;
+                               }
+                               color, 27 32 45 40;
+                       }
+                       description {
+                               state, "focus" 0.0;
+                               inherit, "default" 0.0;
+                               color, 69 143 255 255;
+                       }
+               }
+               part {
+                       name, "padding.border";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 2 2;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1.to, "bg.entry";
+                               rel2 {
+                                       to, "bg.entry";
+                                       relative, 0.0 0.0;
+                               }
+                               visible, 0;
+                       }
+               }
+               part {
+                       name, "bg.entry.border";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 306 46;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1 {
+                                       to, "padding.border";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2 {
+                                       to, "padding.border";
+                                       relative, 1.0 1.0;
+                               }
+                       }
+               }
+               part {
+                       name, PART_USER_LOGIN_PW_DESC;
+                       type, TEXT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               fixed, 1 1;
+                               rel1.to, "bg.entry.border";
+                               rel2.to, "bg.entry.border";
+                               text {
+                                       font, "TizenSans";
+                                       size, 22;
+                                       align, 0.5 0.5;
+                               }
+                               color, 27 32 45 100;
+                               visible, 1;
+                       }
+                       description {
+                               state, "hide" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 0;
+                       }
+                       description {
+                               state, "wrongpw" 0.0;
+                               inherit, "default" 0.0;
+                               color, 220 0 0 255;
+                               visible, 1;
+                       }
+               }
+               part {
+                       name, PART_USER_LOGIN_PW;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               fixed, 1 1;
+                               rel1.to, PART_USER_LOGIN_PW_DESC;
+                               rel2.to, PART_USER_LOGIN_PW_DESC;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name, "show.pw";
+                       signal, SIG_SHOW_PW;
+                       source, SRC_PROG;
+                       action, STATE_SET "default" 0.0;
+                       transition, LINEAR 0.1;
+                       target, PART_USER_LOGIN_PW_DESC;
+               }
+               program {
+                       name, "hide.pw";
+                       signal, SIG_HIDE_PW;
+                       source, SRC_PROG;
+                       action, STATE_SET "hide" 0.0;
+                       transition, LINEAR 0.1;
+                       target, PART_USER_LOGIN_PW_DESC;
+               }
+               program {
+                       name, "show.long.pw";
+                       signal, SIG_SHOW_WRONG_PW;
+                       source, SRC_PROG;
+                       action, STATE_SET "wrongpw" 0.0;
+                       transition, LINEAR 0.1;
+                       target, PART_USER_LOGIN_PW_DESC;
+               }
+               program {
+                       name, "focus.pw";
+                       signal, SIG_FOCUS;
+                       source, SRC_PROG;
+                       action, STATE_SET "focus" 0.0;
+                       transition, LINEAR 0.1;
+                       target, "bg.entry";
+               }
+               program {
+                       name, "unfocus.pw";
+                       signal, SIG_UNFOCUS;
+                       source, SRC_PROG;
+                       action, STATE_SET "default" 0.0;
+                       transition, LINEAR 0.1;
+                       target, "bg.entry";
+               }
+       }
+}
+
+group {
+       name, GRP_UBAR_DELETE;
+       parts {
+               part {
+                       name, "area";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               fixed, 1 1;
+                               visible, 0;
+                       }
+               }
+               part {
+                       name, "padding.text";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 0 25;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1 {
+                                       to, "area";
+                                       relative, 0.5 0.0;
+                               }
+                               rel2 {
+                                       to, "area";
+                                       relative, 0.5 0.0;
+                               }
+                               visible, 0;
+                       }
+               }
+               part {
+                       name, PART_USER_DELETE_MESSAGE;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 500 50;
+                               fixed, 1 1;
+                               align, 0.5 0.0;
+                               rel1 {
+                                       to, "padding.text";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2.to, "padding.text";
+                               color, 0 0 0 255;
+                       }
+               }
+               part {
+                       name, "padding.entry";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 0 20;
+                               fixed, 1 1;
+                               align, 0.5 0.0;
+                               rel1 {
+                                       to, PART_USER_DELETE_MESSAGE;
+                                       relative, 0.5 1.0;
+                               }
+                               rel2 {
+                                       to, PART_USER_DELETE_MESSAGE;
+                                       relative, 0.5 1.0;
+                               }
+                               visible, 0;
+                       }
+               }
+               part {
+                       name, "bg.entry";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 310 50;
+                               fixed, 1 1;
+                               align, 0.5 0.0;
+                               rel1 {
+                                       to, "padding.entry";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2.to, "padding.entry";
+                               color, 27 32 45 40;
+                       }
+                       description {
+                               state, "focus" 0.0;
+                               inherit, "default" 0.0;
+                               color, 69 143 255 255;
+                       }
+               }
+               part {
+                       name, "padding.border";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 2 2;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1.to, "bg.entry";
+                               rel2 {
+                                       to, "bg.entry";
+                                       relative, 0.0 0.0;
+                               }
+                               visible, 0;
+                       }
+               }
+               part {
+                       name, "bg.entry.border";
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 306 46;
+                               fixed, 1 1;
+                               align, 0.0 0.0;
+                               rel1 {
+                                       to, "padding.border";
+                                       relative, 1.0 1.0;
+                               }
+                               rel2 {
+                                       to, "padding.border";
+                                       relative, 1.0 1.0;
+                               }
+                       }
+               }
+               part {
+                       name, PART_USER_LOGIN_PW_DESC;
+                       type, TEXT;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               fixed, 1 1;
+                               rel1.to, "bg.entry.border";
+                               rel2.to, "bg.entry.border";
+                               text {
+                                       font, "TizenSans";
+                                       size, 22;
+                                       align, 0.5 0.5;
+                               }
+                               color, 27 32 45 100;
+                               visible, 1;
+                       }
+                       description {
+                               state, "hide" 0.0;
+                               inherit, "default" 0.0;
+                               visible, 0;
+                       }
+                       description {
+                               state, "wrongpw" 0.0;
+                               inherit, "default" 0.0;
+                               color, 220 0 0 255;
+                               visible, 1;
+                       }
+               }
+               part {
+                       name, PART_USER_LOGIN_PW;
+                       type, SWALLOW;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               fixed, 1 1;
+                               rel1.to, PART_USER_LOGIN_PW_DESC;
+                               rel2.to, PART_USER_LOGIN_PW_DESC;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name, "show.pw";
+                       signal, SIG_SHOW_PW;
+                       source, SRC_PROG;
+                       action, STATE_SET "default" 0.0;
+                       transition, LINEAR 0.1;
+                       target, PART_USER_LOGIN_PW_DESC;
+               }
+               program {
+                       name, "hide.pw";
+                       signal, SIG_HIDE_PW;
+                       source, SRC_PROG;
+                       action, STATE_SET "hide" 0.0;
+                       transition, LINEAR 0.1;
+                       target, PART_USER_LOGIN_PW_DESC;
+               }
+               program {
+                       name, "show.long.pw";
+                       signal, SIG_SHOW_WRONG_PW;
+                       source, SRC_PROG;
+                       action, STATE_SET "wrongpw" 0.0;
+                       transition, LINEAR 0.1;
+                       target, PART_USER_LOGIN_PW_DESC;
+               }
+               program {
+                       name, "focus.pw";
+                       signal, SIG_FOCUS;
+                       source, SRC_PROG;
+                       action, STATE_SET "focus" 0.0;
+                       transition, LINEAR 0.1;
+                       target, "bg.entry";
+               }
+               program {
+                       name, "unfocus.pw";
+                       signal, SIG_UNFOCUS;
+                       source, SRC_PROG;
+                       action, STATE_SET "default" 0.0;
+                       transition, LINEAR 0.1;
+                       target, "bg.entry";
+               }
+       }
+}
diff --git a/edje/images/ico_bg_98.png b/edje/images/ico_bg_98.png
new file mode 100644 (file)
index 0000000..aa0ba5e
Binary files /dev/null and b/edje/images/ico_bg_98.png differ
index 92044b0..dd28d20 100644 (file)
@@ -44,6 +44,7 @@ group {
                                        to, "elm.swallow.content";
                                }
                                min, 120 0;
+                               fixed, 1 0;
                                align, 0.0 1.0;
                        }
                }
@@ -64,6 +65,7 @@ group {
                                        to, "padding.arrow";
                                }
                                min, 15 10;
+                               fixed, 1 1;
                                align, 0.0 1.0;
                        }
                }
index ee2479a..82c9e53 100644 (file)
@@ -63,6 +63,10 @@ styles {
                name, "text_style_22_center";
                base, "font=TizenSans:style=Bold font_size=22  color=#79889b align=center";
        }
+       style {
+               name, "text_style_28_left";
+               base, "font=TizenSans font_size= 28 color=#45476C align=center";
+       }
 }
 
 group {
@@ -528,3 +532,51 @@ group {
                }
        }
 }
+
+group {
+       name, "elm/label/base/slide_style_28_left";
+       inherit, "elm/label/base/slide_style_24_left";
+       parts {
+               part {
+                       name, "elm.text";
+                       type, TEXTBLOCK;
+                       scale, 1;
+                       clip_to, "label.text.clip";
+                       description {
+                               state, "default" 0.0;
+                               rel1.relative, 0.0 0.0;
+                               rel2.relative, 1.0 1.0;
+                               align, 0.0 0.5;
+                               text {
+                                       style, "text_style_28_left";
+                                       align, 0.0 1.0;
+                                       min, 0 1;
+                               }
+                       }
+                       description {
+                               state, "slide_end" 0.0;
+                               inherit, "default" 0.0;
+                               rel1.relative, 1.0 0.0;
+                               rel2.relative, 1.0 1.0;
+                               align, 1.0 0.5;
+                               text {
+                                       style, "text_style_28_left";
+                                       align, 0.0 1.0;
+                                       min, 1 1;
+                               }
+                       }
+                       description {
+                               state, "slide_begin" 0.0;
+                               inherit, "default" 0.0;
+                               rel1.relative, 0.0 0.0;
+                               rel2.relative, 0.0 1.0;
+                               align, 0.0 0.5;
+                               text {
+                                       style, "text_style_28_left";
+                                       align, 0.0 1.0;
+                                       min, 1 1;
+                               }
+                       }
+               }
+       }
+}
index 3a4d8ae..3009330 100644 (file)
@@ -74,7 +74,6 @@ group {
                        scale, 1;
                        description {
                                state, "default" 0.0;
-                               fixed, 0 0;
                                align, 0.0 0.0;
                                rel1 {
                                        to, "pad.left";
@@ -117,9 +116,11 @@ group {
                        scale, 1;
                        description {
                                state, "default" 0.0;
+                               min, 0 90;
+                               fixed, 0 1;
                                text {
                                        font, "TizenSans";
-                                       size, 23;
+                                       size, 30;
                                }
                                rel1.to, "upper_image";
                                rel2.to, "upper_image";
index 509eb41..0ea830f 100644 (file)
@@ -42,6 +42,8 @@
 #define GRP_UBAR_RIGHT_ARROW "ubar.right.arrow"
 #define GRP_UBAR_POPUP "ubar.popup"
 #define GRP_UBAR_POPUP_ITEM "ubar.popup.item"
+#define GRP_UBAR_LOGIN "ubar.login"
+#define GRP_UBAR_DELETE "ubar.delete"
 
 #define PART_HOMEBAR "homebar"
 #define PART_DYNAMICBAR "dynamicbar"
 #define PART_ELM_SWALLOWICON "elm.swallow.icon"
 #define PART_POPUP_TEXT "title,text"
 #define PART_POPUP_USER "popup.user"
-#define PART_POPUP_ENTRY "popup.entry"
+#define PART_POPUP_ENTRY_NAME "popup.entry.name"
+#define PART_POPUP_ENTRY_NAME_DESC "popup.entry.name.desc"
+#define PART_POPUP_ENTRY_PW "popup.entry.pw"
+#define PART_POPUP_ENTRY_PW_DESC "popup.entry.pw.desc"
 #define PART_RIGHT_ARROW "right.arrow"
 #define PART_LEFT_ARROW "left.arrow"
 #define PART_KIDS "kids"
 #define PART_USER_AGE "user.age"
+#define PART_USER_LOGIN_THUMB "user.login.thumb"
+#define PART_USER_LOGIN_NAME "user.login.name"
+#define PART_USER_LOGIN_PW "user.login.pw"
+#define PART_USER_LOGIN_PW_DESC "user.login.pw.desc"
+#define PART_USER_DELETE_MESSAGE "user.delete.message"
 
 #define PART_THUMB_1 "thumb.1"
 #define PART_THUMB_2 "thumb.2"
 #define SIG_SCROLL_UP "elm,action,scroll,up"
 #define SIG_CANCEL_CLICKED "cancel,clicked"
 #define SIG_SHOW_AGE "show.age"
+#define SIG_HIDE_PW "hide.pw"
+#define SIG_SHOW_PW "show.pw"
+#define SIG_SHOW_WRONG_PW "show.wrong.pw"
 
 #define SRC_PROG "prog"
 #define SRC_EDJE "edje"
 #define STYLE_LABEL_SLIDE_CENTER_40 "slide_style_40_center"
 #define STYLE_LABEL_SLIDE_CENTER_22 "slide_style_22_center"
 #define STYLE_LABEL_SLIDE_LEFT_20 "slide_style_20_left"
+#define STYLE_LABEL_SLIDE_LEFT_28 "slide_style_28_left"
 #define STYLE_POPUP_1LINE_2BUTTON "title.1line.2button"
 #define STYLE_POPUP_BOTTOM_1LINE "bottom.1line"
 #define STYLE_POPUP_USER "user"
index e89fc58..ec2a437 100644 (file)
@@ -88,6 +88,9 @@ int engine_ubar_item_get_info(struct engine_ubar_item *it, const char **name,
                const char **thumb_bg, const char **thumb, int *age,
                bool *visible);
 void engine_ubar_item_set_visible(struct engine_ubar_item *it, bool visible);
+bool engine_ubar_item_is_password(struct engine_ubar_item *it,
+               const char *password);
+bool engine_ubar_item_get_authority(struct engine_ubar_item *it);
 
 /* dbar */
 enum engine_dbar_item_style engine_dbar_item_get_style(
index 5c9983e..5de0649 100644 (file)
@@ -1435,12 +1435,31 @@ void engine_ubar_item_set_visible(struct engine_ubar_item *it, bool visible)
        it->visible = visible;
 }
 
+bool engine_ubar_item_is_password(struct engine_ubar_item *it,
+               const char *password)
+{
+       if (!it || !password) {
+               _ERR("Invalid argument");
+               return false;
+       }
+
+       if (!it->password) {
+               _ERR("No permitted user");
+               return false;
+       }
+
+       if (!strcmp(password, it->password))
+               return true;
+       else
+               return false;
+}
+
 int engine_ubar_item_get_info(struct engine_ubar_item *it, const char **name,
                const char **thumb_bg, const char **thumb, int *age,
                bool *visible)
 {
        if (!it) {
-               _ERR("invalid argument");
+               _ERR("Invalid argument");
                return -1;
        }
 
@@ -1458,6 +1477,16 @@ int engine_ubar_item_get_info(struct engine_ubar_item *it, const char **name,
        return 0;
 }
 
+bool engine_ubar_item_get_authority(struct engine_ubar_item *it)
+{
+       if (!it) {
+               _ERR("Invalid argument");
+               return false;
+       }
+
+       return it->authority;
+}
+
 const Eina_List *engine_get_ubar_items(struct engine *eng)
 {
        if (!eng) {
index 71f8134..6f7bd1f 100644 (file)
@@ -689,26 +689,6 @@ static enum bar_event _bar_event(struct bar_info *info,
        return r;
 }
 
-static enum bar_event _key_up(struct bar_info *info, void *ei)
-{
-       struct _hbar_data *bar;
-       enum bar_event r;
-
-       if (!info || !ei)
-               return BAR_EVENT_ERROR;
-       bar = info->data;
-
-       switch (bar->state) {
-       case HBAR_STATE_UBAR:
-               r = bar->ubar->ops->key_up(bar->ubar, ei);
-               break;
-       default:
-               return BAR_EVENT_DONE;
-       }
-
-       return _bar_event(info, ei, r);
-}
-
 static enum bar_event _key_down(struct bar_info *info, void *ei)
 {
        struct _hbar_data *bar;
@@ -1247,7 +1227,6 @@ static struct bar_ops hbar_ops = {
        .is_move        = _is_move,
        .move           = _move,
        .key_down       = _key_down,
-       .key_up         = _key_up,
        .release        = _release,
 };
 
index cb7f3bd..91ac144 100644 (file)
@@ -280,12 +280,6 @@ static Eina_Bool _key_up(void *data, int type, void *ei)
        hscr = data;
 
        switch (hscr->state) {
-       case HOMESCREEN_STATE_HBAR:
-               if (!hscr->hbar)
-                       return ECORE_CALLBACK_CANCEL;
-
-               ev = hscr->hbar->ops->key_up(hscr->hbar, ei);
-               break;
        case HOMESCREEN_STATE_CBAR:
                if (!hscr->cbar)
                        return ECORE_CALLBACK_CANCEL;
index cf10378..ab5507c 100644 (file)
@@ -24,7 +24,7 @@
 #include "defs.h"
 #include "dbg.h"
 
-#define BTN_MAX 2
+#define BTN_MAX 3
 #define KEY_LONG_DUR 1.0
 #define BANNER_DUR 3.0
 #define CTXPOPUP_BTN_WIDTH 254
 #define UBAR_POPUP_PADDING_X 30
 #define BUF_MAX 128
 
+#define MESSAGE_ID "ID"
+#define MESSAGE_PW "Password"
+#define MESSAGE_WRONG_PW "Wrong Password"
 #define TITLE_DELETE_POPUP "Delete User"
-#define MESSAGE_DELETE_POPUP "Are you sure you want to delete user?<br>(All histories will be deleted)"
-#define MESSAGE_DELETE_BANNER "is deleted"
-
+#define TITLE_LOGIN_POPUP "Login"
 #define TITLE_EDIT_POPUP "Edit User"
+#define MESSAGE_DELETE_POPUP "Are you sure you want to delete"
+#define MESSAGE_DELETE_BANNER "is deleted"
 #define MESSAGE_EDIT_BANNER "Editing is completed"
-
 #define MESSAGE_KIDS "It is not available to use some content for over age 17~4, in Kids mode."
 
 #define ASSERT(exp) if (!(exp)) { _ERR(#exp); abort(); }
@@ -53,6 +55,14 @@ enum _ubar_state {
        UBAR_STATE_ITEM_POPUP
 };
 
+enum _popup_state {
+       POPUP_STATE_NONE,
+       POPUP_STATE_LOGIN,
+       POPUP_STATE_ADD,
+       POPUP_STATE_EDIT,
+       POPUP_STATE_DELETE
+};
+
 struct _ubar_item;
 
 struct _ubar_data {
@@ -62,7 +72,6 @@ struct _ubar_data {
        Evas_Object *bx;
        Eina_List *list;
        Evas_Object *base;
-       Ecore_Timer *key_timer;
        struct engine *eng;
        struct _ubar_item *cur;
        struct bar_cb focus_cb;
@@ -79,8 +88,11 @@ struct _ubar_item {
        Evas_Object *ctxpopup;
        Evas_Object *btn[BTN_MAX];
        Evas_Object *popup;
+       Evas_Object *id_entry;
+       Evas_Object *pw_entry;
        struct engine_ubar_item *it;
        struct _ubar_data *bar;
+       enum _popup_state state;
 };
 
 struct _btn_info {
@@ -305,6 +317,39 @@ static int _update_user(struct _ubar_data *bar, struct engine_ubar_item *it)
        return 0;
 }
 
+static Eina_Bool _create_ctxpopup(struct _ubar_item *);
+
+/* FIXME: check user status */
+static Eina_Bool _check_guest_user(struct _ubar_item *user)
+{
+       return EINA_TRUE;
+}
+
+static Eina_Bool _check_add_item(struct _ubar_item *item)
+{
+       return !engine_ubar_item_get_authority(item->it);
+}
+
+static void _clicked(void *data, Evas *e, Evas_Object *obj, void *ei)
+{
+       struct _ubar_data *bar;
+
+       if (!data) {
+               _ERR("Invalid argument");
+               return;
+       }
+
+       bar = data;
+       if (_check_guest_user(bar->user)) {
+               if (_check_add_item(bar->cur)){
+                       /* FIXME: load add item */
+               } else {
+                       _create_ctxpopup(bar->cur);
+                       bar->state = UBAR_STATE_ITEM_CTXPOPUP;
+               }
+       }
+}
+
 static struct _ubar_item *_pack_item(struct _ubar_data *bar,
                struct engine_ubar_item *it)
 {
@@ -362,6 +407,8 @@ static struct _ubar_item *_pack_item(struct _ubar_data *bar,
                        thumb ? thumb : DEF_UBAR_ITEM_THUMB, NULL);
 
        evas_object_event_callback_add(ly,
+                       EVAS_CALLBACK_MOUSE_UP, _clicked, bar);
+       evas_object_event_callback_add(ly,
                        EVAS_CALLBACK_MOUSE_MOVE, _mouse_over, NULL);
        evas_object_smart_callback_add(ly, "focused", _focused, item);
 
@@ -585,10 +632,18 @@ static void _destroy_ctxpopup(struct _ubar_item *item)
 
 static void _destroy_popup(struct _ubar_item *item)
 {
+       int i;
+
        ASSERT(item);
 
        evas_object_del(item->popup);
        item->popup = NULL;
+       item->state = POPUP_STATE_NONE;
+
+       for (i = 0; i < BTN_MAX; i++) {
+               memset(item->btn, 0x00, sizeof(item->btn));
+               item->btn[i] = NULL;
+       }
 
        switch (item->bar->state) {
        case UBAR_STATE_USER_POPUP:
@@ -646,19 +701,19 @@ static enum bar_event _back(struct bar_info *info)
        return r;
 }
 
-static Eina_Bool _add_btn(Evas_Object *p, struct _ubar_item *item,
-               struct _btn_info *btn_info)
+static Eina_Bool _add_popup_btn(Evas_Object *p, struct _ubar_item *item,
+               struct _btn_info *btn_info, int size)
 {
        Evas_Object *btn, *firstbtn;
        int i;
 
-       if (!p || !item) {
+       if (!p || !item || !btn_info) {
                _ERR("Invalid argument");
                return EINA_FALSE;
        }
 
        firstbtn = NULL;
-       for (i = 0; i < BTN_MAX; i++) {
+       for (i = 0; i < size; i++) {
                btn = elm_button_add(p);
                if (!btn) {
                        _ERR("failed to create button");
@@ -688,7 +743,17 @@ static Eina_Bool _add_btn(Evas_Object *p, struct _ubar_item *item,
 static void _popup_cancel_clicked(void *data, Evas *e, Evas_Object *obj,
                void *ei)
 {
-       _destroy_popup(data);
+       struct _ubar_item *item;
+
+       if (!data) {
+               _ERR("Invalid argument");
+               return;
+       }
+
+       item = data;
+
+       item->pw_entry = NULL;
+       _destroy_popup(item);
 }
 
 static Evas_Object *_add_popup(Evas_Object *base, const char *title,
@@ -750,11 +815,56 @@ static void _add_banner(struct _ubar_item *item)
        evas_object_show(banner);
 }
 
+static Eina_Bool _check_password(Evas_Object *entry,
+               struct engine_ubar_item *it)
+{
+       const char *password;
+       Evas_Object *ly;
+
+       if (!entry || !it) {
+               _ERR("Invalid argument");
+               return EINA_FALSE;
+       }
+
+       password = elm_entry_entry_get(entry);
+       if (!password)
+               return EINA_FALSE;
+
+       if (!engine_ubar_item_is_password(it, password)) {
+               elm_entry_entry_set(entry, "");
+               ly = elm_object_parent_widget_get(entry);
+               if (ly) {
+                       elm_object_part_text_set(ly, PART_USER_LOGIN_PW_DESC,
+                                       MESSAGE_WRONG_PW);
+                       elm_object_signal_emit(ly, SIG_SHOW_WRONG_PW, SRC_PROG);
+               }
+               return EINA_FALSE;
+       }
+
+       return EINA_TRUE;
+}
+
 static void _popup_delete_clicked(void *data, Evas *e, Evas_Object *obj,
                void *ei)
 {
+       struct _ubar_item *item;
+
+       if (!data) {
+               _ERR("Invalid argument");
+               return;
+       }
+
+       item = data;
+
+       if (!_check_password(item->pw_entry, item->it))
+               return;
+
+       item->pw_entry = NULL;
        _destroy_popup(data);
+
+       /* TODO: EFL patent
        _add_banner(data);
+       */
 }
 
 static Eina_Bool _add_arrow(struct _ubar_item *item, Evas_Object *p,
@@ -797,7 +907,8 @@ static void _lbl_stop_slide(void *data, Evas_Object *obj, void *ei)
        elm_label_slide_go(data);
 }
 
-static Evas_Object *_add_label(Evas_Object *ly, const char *name)
+static Evas_Object *_add_label(Evas_Object *ly, const char *name,
+               const char *style)
 {
        Evas_Object *lbl;
        const char *s;
@@ -812,7 +923,8 @@ static Evas_Object *_add_label(Evas_Object *ly, const char *name)
                _ERR("failed to add label");
                return NULL;
        }
-       elm_object_style_set(lbl, STYLE_LABEL_SLIDE_CENTER_22);
+       if (style)
+               elm_object_style_set(lbl, style);
        s = edje_object_data_get(elm_layout_edje_get(ly),
                        DATA_TITLE_WIDTH);
        if (s)
@@ -895,7 +1007,7 @@ static struct _ubar_item *_pack_users(struct _ubar_data *bar,
                elm_object_signal_emit(ly, SIG_SHOW_AGE, SRC_PROG);
        }
 
-       lbl = _add_label(ly, name);
+       lbl = _add_label(ly, name, STYLE_LABEL_SLIDE_CENTER_22);
        if (!lbl) {
                _ERR("failed to create name");
                evas_object_del(p);
@@ -977,9 +1089,56 @@ static Eina_Bool _load_users(struct _ubar_data *bar, Evas_Object *p)
        return EINA_TRUE;
 }
 
+static void _entry_focused(void *data, Evas_Object *obj, void *ei)
+{
+       elm_object_signal_emit(data, SIG_HIDE_PW, SRC_PROG);
+       elm_object_signal_emit(data, SIG_FOCUS, SRC_PROG);
+}
+
+static void _entry_unfocused(void *data, Evas_Object *obj, void *ei)
+{
+       if (elm_entry_is_empty(obj)) {
+               elm_object_signal_emit(data, SIG_SHOW_PW, SRC_PROG);
+               elm_object_part_text_set(data, PART_USER_LOGIN_PW_DESC,
+                               MESSAGE_PW);
+       }
+       elm_object_signal_emit(data, SIG_UNFOCUS, SRC_PROG);
+}
+
+static Evas_Object *_add_password_entry(Evas_Object *p, const char *part)
+{
+       Evas_Object *entry;
+
+       if (!p || !part) {
+               _ERR("Invalid argument");
+               return NULL;
+       }
+
+       entry = elm_entry_add(p);
+       if (!entry) {
+               _ERR("failed to create entry");
+               evas_object_del(p);
+               return NULL;
+       }
+       elm_entry_single_line_set(entry, EINA_TRUE);
+       elm_entry_input_panel_language_set(entry,
+                       ELM_INPUT_PANEL_LANG_ALPHABET);
+       elm_entry_cursor_end_set(entry);
+       elm_entry_password_set(entry, EINA_TRUE);
+       /* FIXME: entry scroll style
+       elm_entry_scrollable_set(entry, EINA_TRUE);
+       */
+       elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF,
+                       ELM_SCROLLER_POLICY_OFF);
+       elm_object_part_content_set(p, part, entry);
+       evas_object_show(entry);
+
+       return entry;
+}
+
 static Eina_Bool _add_popup_items(struct _ubar_item *item, Evas_Object *popup)
 {
-       Evas_Object *ly, *entry;
+       Evas_Object *ly, *name_entry, *pw_entry;
 
        if (!item || !popup) {
                _ERR("Invalid argument");
@@ -1013,24 +1172,22 @@ static Eina_Bool _add_popup_items(struct _ubar_item *item, Evas_Object *popup)
                return EINA_FALSE;
        }
 
-       entry = elm_entry_add(ly);
-       if (!entry) {
-               _ERR("failed to create entry");
+       name_entry = _add_password_entry(ly, PART_POPUP_ENTRY_NAME);
+       if (!name_entry) {
+               _ERR("failed to create name entry");
                evas_object_del(ly);
                return EINA_FALSE;
        }
-       elm_entry_single_line_set(entry, EINA_TRUE);
-       elm_entry_input_panel_language_set(entry,
-                       ELM_INPUT_PANEL_LANG_ALPHABET);
-       evas_object_size_hint_weight_set(entry,
-                       EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_size_hint_align_set(entry,
-                       EVAS_HINT_FILL, EVAS_HINT_FILL);
-       /* FIXME: After fixing about IME, focusing should be handled */
-       elm_object_focus_allow_set(entry, EINA_FALSE);
-       elm_entry_cursor_end_set(entry);
-       elm_object_part_content_set(ly, PART_POPUP_ENTRY, entry);
-       evas_object_show(entry);
+       elm_object_part_text_set(ly, PART_POPUP_ENTRY_NAME_DESC, MESSAGE_ID);
+
+
+       pw_entry = _add_password_entry(ly, PART_POPUP_ENTRY_PW);
+       if (!pw_entry) {
+               _ERR("failed to create pw entry");
+               evas_object_del(ly);
+               return EINA_FALSE;
+       }
+       elm_object_part_text_set(ly, PART_POPUP_ENTRY_PW_DESC, MESSAGE_PW);
 
        elm_object_part_text_set(ly, PART_KIDS, MESSAGE_KIDS);
 
@@ -1046,6 +1203,27 @@ static void _popup_add_clicked(void *data, Evas *e, Evas_Object *obj,
        evas_object_del(item->popup);
 }
 
+static void _delete_ctxpopup(struct _ubar_data *bar)
+{
+       if (!bar) {
+               _ERR("Invalid argument");
+               return;
+       }
+
+       switch (bar->state) {
+       case UBAR_STATE_USER_CTXPOPUP:
+               _destroy_ctxpopup(bar->user);
+               bar->state = UBAR_STATE_USER_POPUP;
+               break;
+       case UBAR_STATE_ITEM_CTXPOPUP:
+               _destroy_ctxpopup(bar->cur);
+               bar->state = UBAR_STATE_ITEM_POPUP;
+               break;
+       default:
+               return;
+       }
+}
+
 static Eina_Bool _load_edit_popup(struct _ubar_item *item)
 {
        struct _ubar_data *bar;
@@ -1054,7 +1232,7 @@ static Eina_Bool _load_edit_popup(struct _ubar_item *item)
        struct _btn_info btn_info[] = {
                {
                        "button1",
-                       "Add",
+                       "Edit",
                        _popup_add_clicked
                },
                {
@@ -1070,13 +1248,14 @@ static Eina_Bool _load_edit_popup(struct _ubar_item *item)
        }
        bar = item->bar;
 
-       popup = _add_popup(bar->base, TITLE_EDIT_POPUP, STYLE_POPUP_USER);
+       popup = _add_popup(bar->base, TITLE_EDIT_POPUP, NULL);
        if (!popup) {
                _ERR("failed to create popup");
                return EINA_FALSE;
        }
 
-       if (!_add_btn(popup, item, btn_info)) {
+       if (!_add_popup_btn(popup, item, btn_info,
+                       sizeof(btn_info) / sizeof(btn_info[0]))) {
                _ERR("failed to create popup button");
                evas_object_del(popup);
                return EINA_FALSE;
@@ -1096,19 +1275,60 @@ static Eina_Bool _load_edit_popup(struct _ubar_item *item)
                        elm_object_focus_set(cur->eo, EINA_TRUE);
        }
 
-       switch (bar->state) {
-       case UBAR_STATE_USER_CTXPOPUP:
-               _destroy_ctxpopup(bar->user);
-               bar->state = UBAR_STATE_USER_POPUP;
-               break;
-       case UBAR_STATE_ITEM_CTXPOPUP:
-               _destroy_ctxpopup(bar->cur);
-               bar->state = UBAR_STATE_ITEM_POPUP;
-               break;
-       default:
-               evas_object_del(popup);
+       _delete_ctxpopup(bar);
+       item->state = POPUP_STATE_EDIT;
+
+       return EINA_TRUE;
+}
+
+static Eina_Bool _add_delete_item(Evas_Object *p, struct _ubar_item *item)
+{
+       Evas_Object *ly, *entry, *lbl;
+       const char *name;
+       char buf[BUF_MAX];
+
+       if (!p || !item || !item->it) {
+               _ERR("Invalid argument");
+               return EINA_FALSE;
+       }
+
+       ly = elm_layout_add(p);
+       if (!ly) {
+               _ERR("failed to create layout");
+               return EINA_FALSE;
+       }
+       elm_layout_file_set(ly, EDJEFILE, GRP_UBAR_DELETE);
+       elm_object_content_set(p, ly);
+       evas_object_show(ly);
+
+       engine_ubar_item_get_info(item->it, &name, NULL, NULL, NULL, NULL);
+       snprintf(buf, sizeof(buf), "%s %s?", MESSAGE_DELETE_POPUP,
+                       name ? name : "");
+
+       lbl = elm_label_add(ly);
+       if (!lbl) {
+               _ERR("failed to create label");
+               evas_object_del(ly);
+               return EINA_FALSE;
+       }
+       elm_object_text_set(lbl, buf);
+       elm_object_style_set(lbl, STYLE_LABEL_SLIDE_CENTER_22);
+       elm_label_slide_speed_set(lbl, LABEL_SLIDE_SPEED);
+       elm_label_slide_mode_set(lbl, ELM_LABEL_SLIDE_MODE_AUTO);
+       elm_object_part_content_set(ly, PART_USER_DELETE_MESSAGE, lbl);
+
+       entry = _add_password_entry(ly, PART_USER_LOGIN_PW);
+       if (!entry) {
+               _ERR("failed to create entry");
+               evas_object_del(ly);
                return EINA_FALSE;
        }
+       elm_object_part_text_set(ly, PART_USER_LOGIN_PW_DESC, MESSAGE_PW);
+       evas_object_smart_callback_add(entry, "focused", _entry_focused, ly);
+       evas_object_smart_callback_add(entry, "unfocused", _entry_unfocused,
+                       ly);
+
+       item->pw_entry = entry;
 
        return EINA_TRUE;
 }
@@ -1134,38 +1354,178 @@ static Eina_Bool _load_delete_popup(struct _ubar_item *item)
                _ERR("Invalid argument");
                return EINA_FALSE;
        }
+
        bar = item->bar;
+       _delete_ctxpopup(bar);
 
-       popup = _add_popup(bar->base, TITLE_DELETE_POPUP,
-                       STYLE_POPUP_1LINE_2BUTTON);
+       popup = _add_popup(bar->base, TITLE_DELETE_POPUP, NULL);
        if (!popup) {
                _ERR("failed to create popup");
                return EINA_FALSE;
        }
-       elm_object_text_set(popup, MESSAGE_DELETE_POPUP);
 
-       if (!_add_btn(popup, item, btn_info)) {
+       if (!_add_popup_btn(popup, item, btn_info,
+                       sizeof(btn_info) / sizeof(btn_info[0]))) {
                _ERR("failed to create popup button");
                evas_object_del(popup);
                return EINA_FALSE;
        }
-
+       evas_object_show(popup);
        item->popup = popup;
 
-       switch (bar->state) {
-       case UBAR_STATE_USER_CTXPOPUP:
-               _destroy_ctxpopup(bar->user);
-               bar->state = UBAR_STATE_USER_POPUP;
-               break;
-       case UBAR_STATE_ITEM_CTXPOPUP:
-               _destroy_ctxpopup(item->bar->cur);
-               bar->state = UBAR_STATE_ITEM_POPUP;
-               break;
-       default:
+       if (!_add_delete_item(popup, item)) {
+               _ERR("failed to create login item");
+               evas_object_del(popup);
+               return EINA_FALSE;
+       }
+       elm_object_signal_emit(item->eo, SIG_HLIGHT_FROM_POPOVER, SRC_PROG);
+       item->state = POPUP_STATE_DELETE;
+
+       return EINA_TRUE;
+}
+
+static void _cancel_clicked(void *data, Evas *e, Evas_Object *obj, void *ei)
+{
+       struct _ubar_item *item;
+
+       if (!data) {
+               _ERR("Invalid argument");
+               return;
+       }
+
+       item = data;
+
+       item->pw_entry = NULL;
+       _destroy_popup(item);
+}
+
+static void _login_clicked(void *data, Evas *e, Evas_Object *obj, void *ei)
+{
+       struct _ubar_item *item;
+
+       if (!data) {
+               _ERR("Invalid argument");
+               return;
+       }
+
+       item = data;
+
+       if (!_check_password(item->pw_entry, item->it))
+               return;
+
+       item->pw_entry = NULL;
+       _destroy_popup(item);
+}
+
+static Eina_Bool _add_login_item(Evas_Object *p, struct _ubar_item *item)
+{
+       Evas_Object *ly, *ic, *lbl, *entry;
+       bool visible;
+       const char *name, *thumb;
+
+       if (!p || !item || !item->it) {
+               _ERR("Invalid argument");
+               return EINA_FALSE;
+       }
+
+       engine_ubar_item_get_info(item->it, &name, NULL, &thumb, NULL, &visible);
+       if (!visible)
+               return EINA_FALSE;
+
+       ly = elm_layout_add(p);
+       if (!ly) {
+               _ERR("failed to create layout");
+               return EINA_FALSE;
+       }
+       elm_layout_file_set(ly, EDJEFILE, GRP_UBAR_LOGIN);
+       elm_object_content_set(p, ly);
+       evas_object_show(ly);
+
+       ic = elm_icon_add(ly);
+       if (!ic) {
+               _ERR("failed to create icon");
+               evas_object_del(ly);
+               return EINA_FALSE;
+       }
+       elm_image_file_set(ic, thumb ? thumb : DEF_UBAR_ITEM_THUMB, NULL);
+       evas_object_color_set(ic, 66, 71, 108, 255);
+       elm_object_part_content_set(ly, PART_USER_LOGIN_THUMB, ic);
+
+       lbl = elm_label_add(ly);
+       if (!lbl) {
+               _ERR("failed to create label");
+               evas_object_del(ly);
+               return EINA_FALSE;
+       }
+       elm_object_part_content_set(ly, PART_USER_LOGIN_NAME, lbl);
+       elm_object_text_set(lbl, name);
+       elm_object_style_set(lbl, STYLE_LABEL_SLIDE_LEFT_28);
+       elm_label_slide_speed_set(lbl, LABEL_SLIDE_SPEED);
+       elm_label_slide_mode_set(lbl, ELM_LABEL_SLIDE_MODE_AUTO);
+
+       entry = _add_password_entry(ly, PART_USER_LOGIN_PW);
+       if (!entry) {
+               _ERR("failed to create entry");
+               evas_object_del(ly);
+               return EINA_FALSE;
+       }
+       elm_object_part_text_set(ly, PART_USER_LOGIN_PW_DESC, MESSAGE_PW);
+       evas_object_smart_callback_add(entry, "focused", _entry_focused, ly);
+       evas_object_smart_callback_add(entry, "unfocused", _entry_unfocused,
+                       ly);
+
+       item->pw_entry = entry;
+
+       return EINA_TRUE;
+}
+
+static Eina_Bool _load_login_popup(struct _ubar_item *item)
+{
+       Evas_Object *popup;
+       struct _btn_info btn_info[] = {
+               {
+                       "button1",
+                       "Login",
+                       _login_clicked
+               },
+               {
+                       "button2",
+                       "Cancel",
+                       _cancel_clicked
+               }
+       };
+
+       if (!item) {
+               _ERR("Invalid argument");
+               return EINA_FALSE;
+       }
+
+       _delete_ctxpopup(item->bar);
+
+       popup = _add_popup(item->bar->base, TITLE_LOGIN_POPUP, NULL);
+       if (!popup) {
+               _ERR("failed to create popup");
+               return EINA_FALSE;
+       }
+
+       if (!_add_popup_btn(popup, item, btn_info,
+                       sizeof(btn_info) / sizeof(btn_info[0]))) {
+               _ERR("failed to create popup button");
+               evas_object_del(popup);
+               return EINA_FALSE;
+       }
+       evas_object_show(popup);
+
+       if (!_add_login_item(popup, item)) {
+               _ERR("failed to create login item");
                evas_object_del(popup);
                return EINA_FALSE;
        }
 
+       item->popup = popup;
+       item->state = POPUP_STATE_LOGIN;
+       elm_object_signal_emit(item->eo, SIG_HLIGHT_FROM_POPOVER, SRC_PROG);
+
        return EINA_TRUE;
 }
 
@@ -1181,13 +1541,24 @@ static void _ctxpopup_delete_clicked(void *data, Evas *e, Evas_Object *obj,
        _load_delete_popup(data);
 }
 
-static Eina_Bool _add_popup_btn(struct _ubar_item *item, Evas_Object *base)
+static void _ctxpopup_login_clicked(void *data, Evas *e, Evas_Object *obj,
+               void *ei)
+{
+       _load_login_popup(data);
+}
+
+static Eina_Bool _add_ctxpopup_btn(struct _ubar_item *item, Evas_Object *base)
 {
        Evas_Object *btn, *firstbtn;
        int i;
        struct _btn_info btn_info[] = {
                {
                        NULL,
+                       "Login",
+                       _ctxpopup_login_clicked
+               },
+               {
+                       NULL,
                        "Edit",
                        _ctxpopup_edit_clicked
                },
@@ -1233,10 +1604,11 @@ static Eina_Bool _add_popup_btn(struct _ubar_item *item, Evas_Object *base)
        return EINA_TRUE;
 }
 
-static Eina_Bool _create_popup(struct _ubar_item *item)
+static Eina_Bool _create_ctxpopup(struct _ubar_item *item)
 {
        Evas_Object *ctxpopup, *box, *win;
        Evas_Coord x, w;
+       const char *s;
 
        if (!item) {
                _ERR("Invalid argument");
@@ -1257,10 +1629,10 @@ static Eina_Bool _create_popup(struct _ubar_item *item)
        elm_object_style_set(ctxpopup, STYLE_CTXPOPUP_HOVER);
        elm_ctxpopup_direction_priority_set(ctxpopup, 0, 0, 0, 0);
        evas_object_geometry_get(item->ic, &x, NULL, &w, NULL);
-       evas_object_move(ctxpopup,
-                       (x - CTXPOPUP_BTN_WIDTH / 2 + w / 2) *
-                       elm_config_scale_get(),
-                       POSITION_CTXPOPUP_Y * elm_config_scale_get());
+       s = edje_object_data_get(elm_layout_edje_get(item->eo),
+                       DATA_TITLE_WIDTH);
+       evas_object_move(ctxpopup, (x + atoi(s) / 2) * elm_config_scale_get(),
+                       POSITION_CTXPOPUP_Y *elm_config_scale_get());
 
        box = elm_box_add(ctxpopup);
        if (!box) {
@@ -1272,7 +1644,7 @@ static Eina_Bool _create_popup(struct _ubar_item *item)
        evas_object_show(box);
        evas_object_show(ctxpopup);
 
-       if (!_add_popup_btn(item, box)) {
+       if (!_add_ctxpopup_btn(item, box)) {
                _ERR("failed to create popup button");
                evas_object_del(ctxpopup);
                return EINA_FALSE;
@@ -1284,31 +1656,34 @@ static Eina_Bool _create_popup(struct _ubar_item *item)
        return EINA_TRUE;
 }
 
-static Eina_Bool _long_key_cb(void *data)
+static Eina_Bool _check_popup_state(struct _ubar_item *item)
 {
-       struct _ubar_data *bar;
-
-       if (!data) {
+       Eina_Bool r;
+       if (!item) {
                _ERR("Invalid argument");
                return EINA_FALSE;
        }
 
-       bar = data;
-
-       switch (bar->state) {
-       case UBAR_STATE_USER:
-               _create_popup(bar->user);
-               bar->state = UBAR_STATE_USER_CTXPOPUP;
+       r = EINA_FALSE;
+       switch (item->state) {
+       case POPUP_STATE_LOGIN:
+       case POPUP_STATE_DELETE:
+               if (elm_object_focus_get(item->btn[0])) {
+                               if (_check_password(item->pw_entry, item->it))
+                       r = EINA_TRUE;
+               } else if (elm_object_focus_get(item->btn[1]))
+                       r = EINA_TRUE;
                break;
-       case UBAR_STATE_ITEM:
-               _create_popup(bar->cur);
-               bar->state = UBAR_STATE_ITEM_CTXPOPUP;
+       case POPUP_STATE_EDIT:
+               if (elm_object_focus_get(item->btn[0]) ||
+                               elm_object_focus_get(item->btn[1]))
+                       r = EINA_TRUE;
                break;
        default:
-               break;
+               return EINA_FALSE;
        }
 
-       return EINA_TRUE;
+       return r;
 }
 
 static enum bar_event _enter(struct bar_info *info)
@@ -1326,29 +1701,37 @@ static enum bar_event _enter(struct bar_info *info)
        r = EINA_FALSE;
        switch (bar->state) {
        case UBAR_STATE_USER:
+               r = EINA_TRUE;
+               if (_check_guest_user(bar->user))
+                       break;
+               break;
        case UBAR_STATE_ITEM:
-               if (!bar->key_timer)
-                       bar->key_timer = ecore_timer_add(KEY_LONG_DUR,
-                                       _long_key_cb, bar);
                r = EINA_TRUE;
+               if (_check_guest_user(bar->user)) {
+                       if (_check_add_item(bar->cur)){
+                               /* FIXME: load add item */
+                       } else {
+                               _create_ctxpopup(bar->cur);
+                               bar->state = UBAR_STATE_ITEM_CTXPOPUP;
+                       }
+               }
                break;
        case UBAR_STATE_USER_CTXPOPUP:
-               if (!bar->user->ctxpopup)
-                       break;
-
-               if (elm_object_focus_get(bar->user->btn[0]))
-                       r = _load_edit_popup(bar->user);
-               else
-                       r = _load_delete_popup(bar->user);
+               r = EINA_TRUE;
                break;
        case UBAR_STATE_ITEM_CTXPOPUP:
                if (!bar->cur->ctxpopup)
                        break;
 
                if (elm_object_focus_get(bar->cur->btn[0]))
-                       r = _load_edit_popup(bar->cur);
-               else
-                       r = _load_delete_popup(bar->cur);
+                       r = _load_login_popup(bar->cur);
+               else if (elm_object_focus_get(bar->cur->btn[1])) {
+                       if (_check_guest_user(bar->user))
+                               r = _load_edit_popup(bar->cur);
+               } else if (elm_object_focus_get(bar->cur->btn[2])) {
+                       if (_check_guest_user(bar->user))
+                               r = _load_delete_popup(bar->cur);
+               }
                break;
        case UBAR_STATE_USER_POPUP:
                if (!bar->user->popup)
@@ -1361,7 +1744,8 @@ static enum bar_event _enter(struct bar_info *info)
                if (!bar->cur->popup)
                        break;
 
-               _destroy_popup(bar->cur);
+               if (_check_popup_state(bar->cur))
+                       _destroy_popup(bar->cur);
                r = EINA_TRUE;
                break;
        default:
@@ -1371,28 +1755,6 @@ static enum bar_event _enter(struct bar_info *info)
        return r ? BAR_EVENT_DONE : BAR_EVENT_PASS;
 }
 
-static enum bar_event _key_up(struct bar_info *info, void *ei)
-{
-       struct _ubar_data *bar;
-       Ecore_Event_Key *ev;
-
-       if (!info || !ei)
-               return BAR_EVENT_ERROR;
-
-       ev = ei;
-       bar = info->data;
-
-       if (!strcmp(ev->keyname, KEY_ENTER)) {
-               if (!bar->key_timer)
-                       return BAR_EVENT_DONE;
-
-               ecore_timer_del(bar->key_timer);
-               bar->key_timer = NULL;
-       }
-
-       return BAR_EVENT_DONE;
-}
-
 static enum bar_event _key_down(struct bar_info *info, void *ei)
 {
        Ecore_Event_Key *ev;
@@ -1489,7 +1851,6 @@ static struct bar_ops ubar_ops = {
        .is_move        = _is_move,
        .move           = _move_user,
        .key_down       = _key_down,
-       .key_up         = _key_up,
        .release        = _release,
 };