Channel layout: Added progressbar and progressbar style 30/48830/1
authorHyojung Jo <hj903.jo@samsung.com>
Wed, 30 Sep 2015 09:04:14 +0000 (18:04 +0900)
committerHyojung Jo <hj903.jo@samsung.com>
Wed, 30 Sep 2015 09:04:14 +0000 (18:04 +0900)
Change-Id: I11c7b8bd51467db8ac12b55da57f0f6cdd44d968
Signed-off-by: Hyojung Jo <hj903.jo@samsung.com>
include/define.h
include/utils.h
res/layout/channel.edc
res/settings-theme.edc
res/widget/progressbar.edc [new file with mode: 0644]
src/common/utils.c
src/layout/layout_channel.c

index f9fdc3c..89f6419 100644 (file)
 /* Style */
 #define STYLE_MENU_BTN "style.menu.button"
 #define STYLE_BASE_BTN "style.base.button"
+#define STYLE_SEARCH_PB "style.search.progressbar"
 
 /* Signal */
 #define SIG_FOCUSED "elm,action,focus"
 #define SIG_UNFOCUSED "elm,action,unfocus"
 #define SIG_SELECTED "selected"
-#define SIG_GUIDE "signal.guide"
+#define SIG_SEARCH_INIT "signal.search.init"
 #define SIG_SEARCHING "signal.searching"
 #define SIG_SEARCH_COMPLETE "signal.search.complete"
 
@@ -78,9 +79,9 @@
 
 /* String for channel layout */
 #define STR_CHANNEL_TITLE "Auto Program"
-#define STR_SEARCH_GUIDE1 "Connect TV cable to antenna / cable input socket<br>"\
+#define STR_SEARCH_INIT1 "Connect TV cable to antenna / cable input socket<br>"\
        "behind the TV to start tuning.<br>You can search all available channels."
-#define STR_SEARCH_GUIDE2 "Press start to search and store channels."
+#define STR_SEARCH_INIT2 "Press start to search and store channels."
 #define STR_SEARCHING1 "Auto Program is finding channels for you.<br>"\
        "To skip current step, Press stop."
 #define STR_SEARCHING2 "%d Ch found"
index 2208189..400ded6 100644 (file)
@@ -23,5 +23,7 @@ Evas_Object *utils_add_box(Evas_Object *parent, const char *part,
                Eina_Bool horizontal, int pad_h, int pad_v);
 Evas_Object *utils_add_button(Evas_Object *parent, const char *part,
                const char *style, const char *text);
+Evas_Object *utils_add_progressbar(Evas_Object *parent, const char *part,
+               const char *style);
 
 #endif /* __AIR_SETTINGS_UTILS_H__ */
index 50418d8..83b3f93 100644 (file)
@@ -162,14 +162,17 @@ group {
                        scale, 1;
                        description {
                                state, "default" 0.0;
-                               min, 0 4;
-                               rel1.to, "padding.progressbar";
+                               min, 568 4;
+                               rel1 {
+                                       to, "padding.progressbar";
+                                       relative, 0.5 0.0;
+                               }
                                rel2 {
                                        to, "padding.progressbar";
-                                       relative, 1.0 0.0;
+                                       relative, 0.5 0.0;
                                }
                                align, 0.5 1.0;
-                               fixed, 0 1;
+                               fixed, 1 1;
                                visible, 0;
                        }
                        description {
@@ -247,8 +250,8 @@ group {
 
        programs {
                program {
-                       name, SIG_GUIDE;
-                       signal, SIG_GUIDE;
+                       name, SIG_SEARCH_INIT;
+                       signal, SIG_SEARCH_INIT;
                        source, SRC_ELM;
                        action, STATE_SET "default" 0.0;
                        target, PART_SUBTEXT1;
index f486272..c3edd6b 100644 (file)
@@ -18,4 +18,5 @@
 
 collections {
        #include "widget/button.edc"
+       #include "widget/progressbar.edc"
 }
diff --git a/res/widget/progressbar.edc b/res/widget/progressbar.edc
new file mode 100644 (file)
index 0000000..a83209e
--- /dev/null
@@ -0,0 +1,55 @@
+group {
+       name, "elm/progressbar/horizontal/style.search.progressbar";
+       parts {
+               part {
+                       name, "bg";
+                       type, RECT;
+                       mouse_events, 0;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               color, 206 206 206 255;
+                       }
+               }
+
+               part {
+                       name, "elm.cur.progressbar";
+                       mouse_events, 0;
+                       scale, 1;
+                       dragable {
+                               confine, "bg";
+                               x, 1 1 1;
+                               y, 0 0 0;
+                       }
+                       description {
+                               state, "default" 0.0;
+                               min, 0 4;
+                               fixed, 0 1;
+                               visible, 0;
+                               rel1 {
+                                       to, "bg";
+                                       relative, 0.0 0.0;
+                               }
+                               rel2.to, "bg";
+                       }
+               }
+
+               part {
+                       name, "elm.progress.progressbar";
+                       type, RECT;
+                       mouse_events, 0;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               min, 0 0;
+                               fixed, 1 0;
+                               rel1.to, "bg";
+                               rel2 {
+                                       to_y, "bg";
+                                       to_x, "elm.cur.progressbar";
+                               }
+                               color, 64 136 211 255;
+                       }
+               }
+       }
+}
index 5a66ce2..a5c109f 100644 (file)
@@ -102,3 +102,28 @@ Evas_Object *utils_add_button(Evas_Object *parent, const char *part,
 
        return btn;
 }
+
+Evas_Object *utils_add_progressbar(Evas_Object *parent, const char *part,
+               const char *style)
+{
+       Evas_Object *pb;
+
+       if (!parent) {
+               _ERR("Invalid argument.");
+               return NULL;
+       }
+
+       pb = elm_progressbar_add(parent);
+       if (!pb) {
+               _ERR("elm_progressbar_add failed.");
+               return NULL;
+       }
+
+       if (part)
+               elm_object_part_content_set(parent, part, pb);
+
+       if (style)
+               elm_object_style_set(pb, style);
+
+       return pb;
+}
index 5e4a4b7..f19c353 100644 (file)
@@ -35,6 +35,7 @@ struct _priv {
        Evas_Object *base;
        Evas_Object *ly;
        Evas_Object *btn;
+       Evas_Object *pb;
        enum search_state cur_state;
        layoutmgr *lmgr;
 };
@@ -90,8 +91,8 @@ static void _channel_search_stop(struct _priv *priv)
 
 static void _channel_search_init(struct _priv *priv)
 {
-       _update_layout_text(priv, SIG_GUIDE, STR_SEARCH_GUIDE1,
-                       STR_SEARCH_GUIDE2, STR_START);
+       _update_layout_text(priv, SIG_SEARCH_INIT, STR_SEARCH_INIT1,
+                       STR_SEARCH_INIT2, STR_START);
 
        priv->cur_state = STATE_INIT;
 }
@@ -142,7 +143,7 @@ static input_handler _input_handler = {
 static bool _create(layoutmgr *lmgr, void *data)
 {
        struct _priv *priv;
-       Evas_Object *base, *ly, *btn;
+       Evas_Object *base, *ly, *btn, *pb;
 
        if (!lmgr) {
                _ERR("Invalid argument.");
@@ -170,6 +171,13 @@ static bool _create(layoutmgr *lmgr, void *data)
                return false;
        }
 
+       pb = utils_add_progressbar(ly, PART_PROGRESSBAR, STYLE_SEARCH_PB);
+       if (!pb) {
+               _ERR("Addprogress bar failed.");
+               evas_object_del(ly);
+               return false;
+       }
+
        priv = calloc(1, sizeof(*priv));
        if (!priv) {
                _ERR("Calloc failed.");
@@ -181,6 +189,7 @@ static bool _create(layoutmgr *lmgr, void *data)
        priv->base = base;
        priv->ly = ly;
        priv->btn = btn;
+       priv->pb = pb;
 
        inputmgr_add_callback(btn, 0, &_input_handler, priv);
        layoutmgr_set_layout_data(lmgr, LAYOUT_ID_CHANNEL, priv);