From: Soohye Shin Date: Wed, 19 Aug 2015 09:45:29 +0000 (+0900) Subject: apply customized entry theme to name X-Git-Tag: accepted/tizen/tv/20150821.130446~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F39%2F46339%2F4;p=profile%2Ftv%2Fapps%2Fnative%2Fair_home.git apply customized entry theme to name Change-Id: I18a6cbfd6cdcc7b43da60901f755ef2bacc34e48 Signed-off-by: Soohye Shin --- diff --git a/edje/home-theme.edc b/edje/home-theme.edc index e7ee92e..da6ee29 100644 --- a/edje/home-theme.edc +++ b/edje/home-theme.edc @@ -19,4 +19,5 @@ collections { #include "widget/label.edc" #include "widget/gengrid.edc" + #include "widget/entry.edc" } diff --git a/edje/images/search_searchbar_small_bg_dis.png b/edje/images/search_searchbar_small_bg_dis.png new file mode 100644 index 0000000..bf1ee95 Binary files /dev/null and b/edje/images/search_searchbar_small_bg_dis.png differ diff --git a/edje/images/search_searchbar_small_bg_foc.png b/edje/images/search_searchbar_small_bg_foc.png new file mode 100644 index 0000000..63a5dad Binary files /dev/null and b/edje/images/search_searchbar_small_bg_foc.png differ diff --git a/edje/images/search_searchbar_small_bg_nor.png b/edje/images/search_searchbar_small_bg_nor.png index 2b07822..974cc46 100644 Binary files a/edje/images/search_searchbar_small_bg_nor.png and b/edje/images/search_searchbar_small_bg_nor.png differ diff --git a/edje/view/useredit.edc b/edje/view/useredit.edc index ecf6169..ec37a8a 100644 --- a/edje/view/useredit.edc +++ b/edje/view/useredit.edc @@ -370,8 +370,8 @@ group { } } part { - name, "border.name"; - type, IMAGE; + name, PART_USER_EDIT_CONTENTS_NAME; + type, SWALLOW; scale, 1; description { state, "default" 0.0; @@ -383,53 +383,6 @@ group { min, 436 64; fixed, 1 1; align, 0.0 0.0; - fixed, 1 1; - image { - normal, "search_searchbar_small_bg_nor.png"; - border, 4 4 4 4; - border_scale, 1; - } - visible, 1; - } - description { - state, "focus"; - inherit, "default" 0.0; - visible, 0; - } - } - part { - name, PART_USER_EDIT_CONTENTS_NAME; - type, SWALLOW; - scale, 1; - description { - state, "default" 0.0; - rel1 { - to, "border.name"; - relative, 0.5 0.5; - } - rel2 { - to, "border.name"; - relative, 0.5 0.5; - } - min, 432 60; - fixed, 1 1; - } - } - part { - name, "disable.name"; - type, RECT; - scale, 1; - description { - state, "default" 0.0; - rel1.to, PART_USER_EDIT_CONTENTS_NAME; - rel2.to, PART_USER_EDIT_CONTENTS_NAME; - color, 200 200 200 100; - visible, 0; - } - description { - state, "disable"; - inherit, "default" 0.0; - visible, 1; } } part { @@ -634,36 +587,6 @@ group { } } } - programs { - program { - name, "sig,focus"; - signal, SIG_FOCUS; - source, SRC_PROG; - action, STATE_SET "focus" 0.0; - target, "border.name"; - } - program { - name, "sig,unfocus"; - signal, SIG_UNFOCUS; - source, SRC_PROG; - action, STATE_SET "default" 0.0; - target, "border.name"; - } - program { - name, "sig,disable"; - signal, SIG_DISABLE; - source, SRC_PROG; - action, STATE_SET "disable" 0.0; - target, "disable.name"; - } - program { - name, "sig,enable"; - signal, SIG_ENABLE; - source, SRC_PROG; - action, STATE_SET "default" 0.0; - target, "disable.name"; - } - } } group { diff --git a/edje/widget/entry.edc b/edje/widget/entry.edc new file mode 100644 index 0000000..1dde7c0 --- /dev/null +++ b/edje/widget/entry.edc @@ -0,0 +1,649 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +styles { + style { + name, "entry_single_textblock_style"; + base, "font=TizenSans font_size="32" align=left color=#cccccc wrap=none texti_class=entry left_margin=0 right_margin=0"; + tag, "br" ""; + tag, "ps" ""; + tag, "em" "+ font_style=Oblique"; + tag, "link" "+ color=#800 underline=on underline_color=#8008"; + tag, "hilight" "+ font_weight=Bold"; + tag, "preedit" "+ underline=on underline_color=#000"; + tag, "preedit_sel" "+ backing=on backing_color=#000 color=#FFFFFF"; + } + style { + name, "entry_single_textblock_selected_style"; + base, "font=TizenSans font_size="32" align=left color=#0077f6 wrap=none text_class=entry left_margin=0 right_margin=0"; + tag, "br" ""; + tag, "ps" ""; + tag, "em" "+ font_style=Oblique"; + tag, "link" "+ color=#800 underline=on underline_color=#8008"; + tag, "hilight" "+ font_weight=Bold"; + tag, "preedit" "+ underline=on underline_color=#000"; + tag, "preedit_sel" "+ backing=on backing_color=#000 color=#FFFFFF"; + } + style { + name, "entry_single_textblock_disabled_style"; + base, "font=TizenSans font_size="32" align=left color=#c8c8c8 wrap=none text_class=entry left_margin=0 right_margin=0"; + tag, "br" ""; + tag, "ps" ""; + tag, "em" "+ font_style=Oblique"; + tag, "link" "+ color=#00000080 underline=on underline_color=#00000080"; + tag, "hilight" "+ font_weight=Bold"; + tag, "preedit" "+ underline=on underline_color=#000"; + tag, "preedit_sel" "+ backing=on backing_color=#000 color=#FFFFFF"; + } + style { + name, "entry_single_textblock_guide_style"; + base, "font=TizenSans font_size="32" align=left color=#7f7f7f wrap=none text_class=entry left_margin=0 right_margin=0 ellipsis=0.0"; + tag, "br" ""; + tag, "ps" ""; + tag, "em" "+ font_style=Oblique"; + tag, "hilight" "+ font_weight=Bold"; + } +} +styles { + style { + name, "entry_textblock_style"; + base, "font=TizenSans font_size=32 align=left color=#cccccc wrap=none text_class=entry left_margin=0 right_margin=0"; + tag, "em" "+ font_style=Oblique"; + tag, "link" "+ color=#800 underline=on underline_color=#8008"; + tag, "hilight" "+ font_weight=Bold"; + tag, "preedit" "+ underline=on underline_color=#000"; + tag, "preedit_sel" "+ backing=on backing_color=#000 color=#000"; + } + style { + name, "entry_textblock_selected_style"; + base, "font=TizenSans font_size=32 align=left color=#0077f6 wrap=none text_class=entry left_margin=0 right_margin=0"; + tag, "em" "+ font_style=Oblique"; + tag, "link" "+ color=#800 underline=on underline_color=#8008"; + tag, "hilight" "+ font_weight=Bold"; + tag, "preedit" "+ underline=on underline_color=#000"; + tag, "preedit_sel" "+ backing=on backing_color=#000 color=#000"; + } + style { + name, "entry_textblock_disabled_style"; + base, "font=TizenSans font_size=32 align=left color=#3d3d3d wrap=none text_class=entry left_margin=0 right_margin=0"; + tag, "em" "+ font_style=Oblique"; + tag, "link" "+ color=#00000080 underline=on underline_color=#00000080"; + tag, "hilight" "+ font_weight=Bold"; + tag, "preedit" "+ underline=on underline_color=#000"; + tag, "preedit_sel" "+ backing=on backing_color=#000 color=#000"; + } + style { + name, "entry_textblock_guide_style"; + base, "font=TizenSans font_size=32 align=left color=#7f7f7f wrap=none text_class=entry left_margin=0 right_margin=0 ellipsis=0.0"; + tag, "em" "+ font_style=Oblique"; + tag, "hilight" "+ font_weight=Bold"; + } +} +images { + image, "search_searchbar_small_bg_foc.png" COMP; + image, "search_searchbar_small_bg_nor.png" COMP; + image, "search_searchbar_small_bg_dis.png" COMP; +} +group { + name, "elm/scroller/entry/contents"; + alias, "elm/scroller/entry_single/contents"; + parts { + part { + name, "bg"; + description { + state, "default" 0.0; + visible, 0; + } + } + part { + name, "pad.left"; + type, SPACER; + scale, 1; + description { + state, "default" 0.0; + min, 28 5; + max, 28 5; + fixed, 1 1; + rel1.to, "bg"; + align, 0.0 0.0; + } + } + part { + name, "pad.right"; + type, SPACER; + scale, 1; + description { + state, "default" 0.0; + min, 30 5; + max, 30 5; + fixed, 1 1; + rel2.to, "bg"; + align, 1.0 1.0; + } + } + part { + name, "base_highlight"; + after, "bg"; + scale, 1; + description { + state, "default" 0.0; + rel1.to, "bg"; + rel2.to, "bg"; + image { + normal, "search_searchbar_small_bg_nor.png"; + border, 4 4 4 4; + border_scale, 1; + } + } + description { + state, "selected" 0.0; + inherit, "default" 0.0; + image.normal, "search_searchbar_small_bg_foc.png"; + } + description { + state, "over" 0.0; + inherit, "default" 0.0; + image.normal, "search_searchbar_small_bg_foc.png"; + } + description { + state, "disabled" 0.0; + inherit, "default" 0.0; + image.normal, "search_searchbar_small_bg_dis.png"; + } + description { + state, "highlight" 0.0; + inherit, "default" 0.0; + image.normal, "search_searchbar_small_bg_foc.png"; + } + description { + state, "normal" 0.0; + inherit, "default" 0.0; + image.normal, "search_searchbar_small_bg_nor.png"; + } + } + part { + name, "clipper"; + type, RECT; + description { + state, "default" 0.0; + rel1.to, "pad.left"; + rel1.relative, 1.0 1.0; + rel2.to, "pad.right"; + rel2.relative, 0.0 0.0; + } + } + part { + name, "elm.swallow.content"; + type, SWALLOW; + clip_to, "clipper"; + description { + state, "default" 0.0; + rel1.to, "pad.left"; + rel1.relative, 1.0 1.0; + rel2.to, "pad.right"; + rel2.relative, 0.0 0.0; + } + } + } + programs { + program { + name, "disable"; + signal, "elm,state,disabled"; + source, "elm"; + action, STATE_SET "disabled" 0.0; + target, "base_highlight"; + } + program { + name, "select"; + signal, "elm,state,selected"; + source, "elm"; + action, STATE_SET "selected" 0.0; + target, "base_highlight"; + } + program { + name, "over"; + signal, "elm,state,mouse,in"; + source, "elm"; + action, STATE_SET "over" 0.0; + target, "base_highlight"; + } + program { + name, "enable"; + signal, "elm,state,enabled"; + source, "elm"; + action, STATE_SET "default" 0.0; + target, "base_highlight"; + } + program { + name, "go_active"; + signal, "elm,state,selected"; + source, "elm"; + action, STATE_SET "selected" 0.0; + target, "base_highlight"; + } + program { + name, "go_passive"; + signal, "elm,state,unselected"; + source, "elm"; + action, STATE_SET "default" 0.0; + target, "base_highlight"; + } + program { + name, "highlight_show"; + signal, "elm,action,focus_highlight,show"; + source, "elm"; + action, STATE_SET "selected" 0.0; + transition, ACCELERATE 0.01; + target, "base_highlight"; + } + program { + name, "highlight_hide"; + signal, "elm,action,focus_highlight,hide"; + source, "elm"; + action, STATE_SET "normal" 0.0; + transition, DECELERATE 0.01; + target, "base_highlight"; + } + } +} +group { + name, "elm/entry/base/contents"; + alias, "elm/entry/base/default"; + data { + item, "focus_highlight" "on"; + } + parts { + part { + name, "elm.guide"; + type, TEXTBLOCK; + mouse_events, 0; + scale, 1; + description { + state, "default" 0.0; + rel1.to, "elm.text"; + rel2.to, "elm.text"; + text { + style, "entry_textblock_guide_style"; + min, 0 1; + } + } + description { + state, "hidden" 0.0; + inherit, "default" 0.0; + visible, 0; + } + } + part { + name, "elm.text"; + type, TEXTBLOCK; + mouse_events, 1; + scale, 1; + entry_mode, EDITABLE; + select_mode, DEFAULT; + cursor_mode, BEFORE; + multiline, 0; + source, "elm/entry/selection/contents"; + source4, "elm/entry/cursor/contents"; + source5, "elm/entry/anchor/contents"; + description { + state, "default" 0.0; + text { + style, "entry_textblock_style"; + min, 0 1; + align, 0.0 0.5; + } + } + description { + state, "disabled" 0.0; + inherit, "default" 0.0; + text { + style, "entry_textblock_disabled_style"; + min, 0 1; + } + } + description { + state, "selected" 0.0; + inherit, "default" 0.0; + text { + style, "entry_textblock_selected_style"; + min, 0 1; + } + } + description { + state, "highlight" 0.0; + inherit, "default" 0.0; + text { + style, "entry_textblock_selected_style"; + min, 0 1; + } + } + description { + state, "enabled" 0.0; + inherit, "default" 0.0; + text { + style, "entry_textblock_style"; + min, 0 1; + } + } + } + } + programs { + program { + name, "focus"; + signal, "load"; + source, ""; + action, FOCUS_SET; + target, "elm.text"; + } + program { + name, "disable"; + signal, "elm,state,disabled"; + source, "elm"; + action, STATE_SET "disabled" 0.0; + target, "elm.text"; + } + program { + name, "select"; + signal, "elm,state,selected"; + source, "elm"; + action, STATE_SET "selected" 0.0; + target, "elm.text"; + } + program { + name, "over"; + signal, "elm,state,mouse,in"; + source, "elm"; + action, STATE_SET "over" 0.0; + target, "elm.text"; + } + program { + name, "enable"; + signal, "elm,state,enabled"; + source, "elm"; + action, STATE_SET "default" 0.0; + target, "elm.text"; + target, "elm.guide"; + } + program { + name, "go_active"; + signal, "elm,state,selected"; + source, "elm"; + action, STATE_SET "selected" 0.0; + target, "elm.text"; + target, "elm.guide"; + } + program { + name, "go_passive"; + signal, "elm,state,unselected"; + source, "elm"; + action, STATE_SET "default" 0.0; + target, "elm.text"; + target, "elm.guide"; + } + program { + name, "gdisable"; + signal, "elm,guide,disabled"; + source, "elm"; + action, STATE_SET "hidden" 0.0; + target, "elm.guide"; + } + program { + name, "genable"; + signal, "elm,guide,enabled"; + source, "elm"; + action, STATE_SET "default" 0.0; + target, "elm.guide"; + } + program { + name, "highlight_show"; + signal, "elm,action,focus_highlight,show"; + source, "elm"; + action, STATE_SET "selected" 0.0; + transition, ACCELERATE 0.01; + target, "elm.text"; + } + program { + name, "highlight_hide"; + signal, "elm,action,focus_highlight,hide"; + source, "elm"; + action, STATE_SET "normal" 0.0; + transition, DECELERATE 0.01; + target, "elm.text"; + } + } +} +group { + name, "elm/entry/base-single/contents"; + inherit, "elm/entry/base/contents"; + parts { + part { + name, "elm.guide"; + type, TEXTBLOCK; + mouse_events,0; + scale, 1; + description { + state, "default" 0.0; + rel1.to, "elm.text"; + rel2.to, "elm.text"; + text { + style, "entry_single_textblock_guide_style"; + min, 0 1; + } + } + description { + state, "hidden" 0.0; + inherit, "default" 0.0; + visible, 0; + } + } + part { + name, "elm.text"; + type, TEXTBLOCK; + mouse_events, 1; + scale, 1; + multiline, 0; + description { + state, "default" 0.0; + text { + style, "entry_single_textblock_style"; + min, 1 1; + ellipsis, -1; + max, 0 0; + align, 0.0 0.5; + } + } + description { + state, "disabled" 0.0; + inherit, "default" 0.0; + text { + style, "entry_single_textblock_disabled_style"; + } + } + description { + state, "selected" 0.0; + inherit, "default" 0.0; + text { + style, "entry_single_textblock_selected_style"; + min, 0 1; + } + } + description { + state, "enabled" 0.0; + inherit, "default" 0.0; + text { + style, "entry_single_textblock_style"; + min, 0 1; + } + } + } + } +} +group { + name, "elm/entry/base-single-noedit/contents"; + inherit, "elm/entry/base/contents"; + parts { + part { + name, "elm.guide"; + type, TEXTBLOCK; + mouse_events, 0; + scale, 1; + description { + state, "default" 0.0; + rel1.to, "elm.text"; + rel2.to, "elm.text"; + text { + style, "entry_single_textblock_guide_style"; + min, 0 1; + } + } + description { + state, "hidden" 0.0; + inherit, "default" 0.0; + visible, 0; + } + } + part { + name, "elm.text"; + entry_mode, PLAIN; + multiline, 0; + scale, 1; + source, "elm/entry/selection/contents"; + source4, ""; + source5,"elm/entry/anchor/contents"; + description { + state, "default" 0.0; + text { + style, "entry_single_textblock_style"; + min, 1 1; + ellipsis, -1; + max, 0 0; + align, 0.0 0.5; + } + } + description { + state, "disabled" 0.0; + inherit, "default" 0.0; + text { + style, "entry_single_textblock_disabled_style"; + } + } + } + } +} +group { + name, "elm/entry/selection/contents"; + parts { + part { + name, "bg"; + type, RECT; + mouse_events, 0; + scale, 1; + description { + state, "default" 0.0; + color, 128 128 128 128; + } + } + } +} +group { + name, "elm/entry/anchor/contents"; + parts { + part { + name, "bg"; + type, RECT; + mouse_events, 0; + scale, 1; + description { + state, "default" 0.0; + color, 128 0 0 64; + } + } + } +} +group { + name, "elm/entry/cursor/contents"; + parts { + part { + name, "base"; + type, SPACER; + scale, 1; + description { + state, "default" 0.0; + } + } + part { + name, "cursor"; + type, RECT; + mouse_events, 0; + scale, 1; + description { + state, "default" 0.0; + min, 2 36; + max, 2 36; + fixed, 1 1; + color, 69 143 255 255; + visible, 0; + } + description { + state, "visible" 0.0; + inherit, "default" 0.0; + visible, 1; + } + } + } + programs { + program { + name, "blink"; + action, STATE_SET "visible" 0.0; + in, 0.4 0.0; + target, "cursor"; + after, "blink2"; + } + program { + name, "blink2"; + action, STATE_SET "default" 0.0; + in, 0.4 0.0; + target, "cursor"; + after, "blink"; + } + program { + name, "focused"; + signal, "elm,action,focus"; + source, "elm"; + after, "blink"; + } + program { + name, "noblink"; + action, ACTION_STOP; + target, "blink"; + target, "blink2"; + after, "noblink2"; + } + program { + name, "noblink2"; + action, STATE_SET "default" 0.0; + target, "cursor"; + } + program { + name, "unfocused"; + signal, "elm,action,unfocus"; + source, "elm"; + action, STATE_SET "default" 0.0; + target, "cursor"; + after, "noblink"; + } + } +} diff --git a/include/defs.h b/include/defs.h index 4a9dcc1..b190648 100644 --- a/include/defs.h +++ b/include/defs.h @@ -125,8 +125,8 @@ #define SIG_UNFOCUS "sig.unfocus" #define SIG_UNFOCUS_TO_RIGHT "sig.unfocus.to.right" #define SIG_UNFOCUS_TO_LEFT "sig.unfocus.to.left" -#define SIG_DISABLE "sig.disable" -#define SIG_ENABLE "sig.enable" +#define SIG_DISABLE "elm,state,disabled" +#define SIG_ENABLE "elm,state,enabled" #define SIG_SHOW_MASK "sig.show.mask" #define SIG_SHOW "sig.show" #define SIG_SHOW_DONE "sig.show.done" @@ -146,7 +146,7 @@ #define STYLE_LABEL_TITLE_FOCUS "slide_home_title_focus" #define STYLE_LABEL_RECENT_TITLE "slide_recent_title" #define STYLE_LABEL_RECENT_SUBTITLE "slide_recent_subtitle" -#define STYLE_INPUT "input.field" +#define STYLE_INPUT "contents" #define STYLE_GENGRID_ITEM "gengrid_item" #define STYLE_LABEL_ACTION_MENU_TITLE "slide_action_menu_title" #define STYLE_LABEL_ACTION_MENU_TITLE_FOCUS "slide_action_menu_title_focus" diff --git a/src/view/view_user_edit.c b/src/view/view_user_edit.c index e645253..3e30479 100644 --- a/src/view/view_user_edit.c +++ b/src/view/view_user_edit.c @@ -86,8 +86,6 @@ struct _priv { static void _focused(int id, void *data, Evas_Object *obj, Elm_Object_Item *item) { - struct _priv *priv; - switch (id) { case INPUT_HANDLER_TYPE_PHOTO: case INPUT_HANDLER_TYPE_DELETE: @@ -96,9 +94,7 @@ static void _focused(int id, void *data, Evas_Object *obj, elm_object_signal_emit(obj, SIG_FOCUS, SRC_PROG); break; case INPUT_HANDLER_TYPE_ENTRY: - priv = data; elm_object_signal_emit(obj, SIG_SELECT, SRC_ELM); - elm_object_signal_emit(priv->ly, SIG_FOCUS, SRC_PROG); break; default: return; @@ -108,8 +104,6 @@ static void _focused(int id, void *data, Evas_Object *obj, static void _unfocused(int id, void *data, Evas_Object *obj, Elm_Object_Item *item) { - struct _priv *priv; - switch (id) { case INPUT_HANDLER_TYPE_PHOTO: case INPUT_HANDLER_TYPE_DELETE: @@ -118,9 +112,7 @@ static void _unfocused(int id, void *data, Evas_Object *obj, elm_object_signal_emit(obj, SIG_UNFOCUS, SRC_PROG); break; case INPUT_HANDLER_TYPE_ENTRY: - priv = data; elm_object_signal_emit(obj, SIG_UNSELECT, SRC_ELM); - elm_object_signal_emit(priv->ly, SIG_UNFOCUS, SRC_PROG); break; default: return; @@ -721,13 +713,13 @@ static void _load_del_btn(struct _priv *priv) priv->del = btn; } -static void _change_entry(Evas_Object *name, Evas_Object *ly, Eina_Bool disable, - const char *text, const char *signal) +static void _change_entry(Evas_Object *name, Eina_Bool disable, const char *text, + const char *signal) { elm_entry_entry_set(name, text); elm_object_focus_allow_set(name, disable); elm_entry_editable_set(name, disable); - elm_object_signal_emit(ly, signal, SRC_PROG); + elm_object_signal_emit(name, signal, SRC_ELM); } static void _reset(struct _priv *priv) @@ -745,7 +737,7 @@ static void _reset(struct _priv *priv) focus_photo = utils_get_focus_photo_from_photo(photo); _load_user_icon(priv, photo, focus_photo); } else { - _change_entry(priv->name, priv->ly, EINA_TRUE, "", SIG_ENABLE); + _change_entry(priv->name, EINA_TRUE, "", SIG_ENABLE); _load_user_icon(priv, IMAGE_USER_CURRENT_DEFAULT, IMAGE_USER_CURRENT_DEFAULT_FOCUS); } @@ -765,8 +757,7 @@ static void _show(void *data) if (priv->di) { elm_object_part_text_set(priv->base, PART_USER_EDIT_TITLE, MESSAGE_EDIT_USER); - _change_entry(priv->name, priv->ly, EINA_FALSE, priv->di->title, - SIG_DISABLE); + _change_entry(priv->name, EINA_FALSE, priv->di->title, SIG_DISABLE); if (priv->user_type == USER_ITEM_ADMIN && priv->di->type != USER_ITEM_ADMIN) _load_del_btn(priv);