Fixed the sort button to be disabled when any app does not exist 54/45254/1
authorHyojung Jo <hj903.jo@samsung.com>
Tue, 4 Aug 2015 06:44:51 +0000 (15:44 +0900)
committerHyojung Jo <hj903.jo@samsung.com>
Tue, 4 Aug 2015 06:44:51 +0000 (15:44 +0900)
Change-Id: I7654bd93efc1a0f5221456a86af95f175618da73
Signed-off-by: Hyojung Jo <hj903.jo@samsung.com>
include/define.h
res/widget/button.edc
src/view/view_base.c

index 4e3abbbc13533f46896d95ff12b1750701009107..b909aafde04479442102cd9ba97724f0aad82f29 100644 (file)
@@ -63,6 +63,7 @@
 #define SIG_FAVORITE "favorite"
 #define SIG_VISIBLE "visible"
 #define SIG_INVISIBLE "invisible"
+#define SIG_DISABLE "disable"
 
 /* Signal Source */
 #define SRC_MYAPPS "source.myapps"
index e08d3c20f42b4af616fec8dc0a82efbaa260555f..bc76aca837417e35011bd14056f443287fd2c426 100644 (file)
@@ -323,6 +323,11 @@ group {
                                inherit, "default" 0.0;
                                color, 64 136 211 255;
                        }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               color, 87 87 87 127;
+                       }
                }
 
                part {
@@ -347,6 +352,11 @@ group {
                                inherit, "default" 0.0;
                                color, 64 136 211 255;
                        }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               color, 87 87 87 127;
+                       }
                }
 
                part {
@@ -372,6 +382,11 @@ group {
                                inherit, "default" 0.0;
                                color, 64 136 211 255;
                        }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               color, 87 87 87 127;
+                       }
                }
 
                part {
@@ -397,6 +412,11 @@ group {
                                inherit, "default" 0.0;
                                color, 64 136 211 255;
                        }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               color, 87 87 87 127;
+                       }
                }
 
                part {
@@ -443,6 +463,11 @@ group {
                                inherit, "default" 0.0;
                                color, 64 136 211 255;
                        }
+                       description {
+                               state, "disable" 0.0;
+                               inherit, "default" 0.0;
+                               color, 87 87 87 127;
+                       }
                }
        }
 
@@ -515,6 +540,19 @@ group {
                                set_state(PART:"part.inside.line.right", "selected", 0.0);
                        }
                }
+
+               program {
+                       name, SIG_DISABLE;
+                       signal, SIG_DISABLE;
+                       source, SRC_SORT_BTN;
+                       script {
+                               set_state(PART:"elm.text", "disable", 0.0);
+                               set_state(PART:"part.inside.line.up", "disable", 0.0);
+                               set_state(PART:"part.inside.line.down", "disable", 0.0);
+                               set_state(PART:"part.inside.line.left", "disable", 0.0);
+                               set_state(PART:"part.inside.line.right", "disable", 0.0);
+                       }
+               }
        }
 }
 
index 3f42b077ea0ae2f454fd68fe27a936ae8600fb3e..e02c59e41c2ef53a9ab127e7dc300c30147f40d3 100644 (file)
@@ -100,7 +100,13 @@ static void _menu_focused_cb(int id, void *data, Evas_Object *obj,
        switch (id) {
        case MENU_MYAPPS:
                elm_object_signal_emit(priv->base, SIG_VISIBLE, SRC_MYAPPS);
-               elm_object_part_text_set(priv->base, PART_CONTENTS_TEXT, "");
+               if (priv->app_list)
+                       elm_object_part_text_set(priv->base,
+                                       PART_CONTENTS_TEXT, "");
+               else
+                       elm_object_part_text_set(priv->base,
+                                       PART_CONTENTS_TEXT, STR_NO_CONTENTS);
+
                break;
 
        case MENU_APPSTORE:
@@ -452,6 +458,9 @@ static void _sort_mouse_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
        }
        priv = data;
 
+       if (!priv->app_list)
+               return;
+
        if (!_draw_sort_option(priv))
                _ERR("Draw sort ctxpopup failed.");
 }
@@ -696,6 +705,9 @@ static bool _draw_bottom_area(struct _priv *priv)
 
        priv->sort_btn = btn;
 
+       if (!priv->app_list)
+               elm_object_signal_emit(btn, SIG_DISABLE, SRC_SORT_BTN);
+
        c = eina_list_count(priv->app_list);
        snprintf(str, sizeof(str), " %d "STR_APPS, c);
        elm_object_part_text_set(priv->base, PART_APP_COUNT, str);
@@ -711,11 +723,8 @@ static bool _draw_myapps_grid(struct _priv *priv)
        }
 
        priv->app_list = get_app_list();
-       if (!priv->app_list) {
-               elm_object_part_text_set(priv->base, PART_CONTENTS_TEXT,
-                               STR_NO_CONTENTS);
+       if (!priv->app_list)
                return true;
-       }
 
        _sort_by_recently_used(priv);