Fix to align wireless button text with wired text when no ap 87/131087/1
authorAbhishek Sansanwal <abhishek.s94@samsung.com>
Thu, 25 May 2017 10:01:48 +0000 (15:31 +0530)
committerAbhishek Sansanwal <abhishek.s94@samsung.com>
Thu, 25 May 2017 10:08:01 +0000 (15:38 +0530)
Description: In the case that a button of type STYLE_STATUS_BUTTON
returns NULL string as status, the style of the button is reset to
STYLE_NORMAL_BUTTON. This changes the wireless button in network
tab to a NORMAL style button and aligns it with the wired button
in of network menu.

Signed-off-by: Abhishek Sansanwal <abhishek.s94@samsung.com>
Change-Id: Ie7ed01eb0dc0d5ea4591bb58e151952962d03c0f

res/widget/button.edc
src/common/menumgr.c
src/layout/layout_network.c

index e84aff0..210ecae 100755 (executable)
@@ -657,11 +657,9 @@ group {
                                state, "default" 0.0;
                                align, 0.5 0.0;
                                rel1 {
-                                       relative, 0.0 0.2283;
                                        to, "bg.content";
                                }
                                rel2 {
-                                       relative, 1.0 0.4567;
                                        to, "bg.content";
                                }
                                text {
@@ -770,6 +768,19 @@ group {
                        name, "elm.text";
                        description {
                                state, "default" 0.0;
+                               align, 0.5 0.0;
+                               rel1 {
+                                       relative, 0.0 0.2283;
+                                       to, "bg.content";
+                               }
+                               rel2 {
+                                       relative, 1.0 0.4567;
+                                       to, "bg.content";
+                               }
+                               text {
+                                       style: "style.normal";
+                               }
+                               color, COLOR_TEXT_ITEM;
                        }
                        description {
                                state, "focused" 0.0;
index 47de08a..bc1f4e6 100755 (executable)
@@ -148,6 +148,7 @@ void menumgr_update(struct menumgr *m)
        for (i = 0; i < m->len; i++) {
                if (m->info[i]) {
                        if (m->info[i]->status) {
+                               elm_object_style_set(m->btn[i], m->info[i]->style);
                                str = m->info[i]->status(m->data, m->info[i]->id);
 
                                if (!str) {
@@ -156,6 +157,8 @@ void menumgr_update(struct menumgr *m)
                                        elm_object_part_text_set(m->btn[i], PART_MENU_VALUE, STATUS_DEFAULT);
 
                                        elm_object_signal_emit(m->btn[i], SIG_NOTAVAILABLE, "");
+                                       if (!strcmp(m->info[i]->style, STYLE_STATUS_BTN))
+                                               elm_object_style_set(m->btn[i], STYLE_NORMAL_BTN);
                                } else {
                                        str_copy = strdup(str);
                                        token = strtok_r(str, delimiters, &save_ptr);
index 87a4930..06d1807 100644 (file)
@@ -104,7 +104,6 @@ static struct menumgr_info menu_info[] = {
                .title = STR_WIRED,
                .style = STYLE_NORMAL_BTN,
                .disabled = EINA_FALSE,
-               //.status = _get_contrast,
                .status = NULL,
                .progress_value = NULL,
                .progress_evas = NULL,
@@ -127,7 +126,7 @@ static char *_get_connected_ap(void *data, int id)
                free(essid);
                return temp;
        }
-       return strdup("");
+       return NULL;
 }
 
 static void _destroy_status_popup()