From ef3773e2b90b4352d1d5fa776c20f1e445f6e465 Mon Sep 17 00:00:00 2001 From: Radek Kintop Date: Fri, 23 Sep 2016 16:19:34 +0200 Subject: [PATCH] Fix: WiFi password popup had no buttons Change-Id: Iabe807ff8ac8438707419e862e3ea47cdb23f1a4 Signed-off-by: Radek Kintop --- include/define.h | 4 ++-- res/layout/network.edc | 45 ++++++++++++++++++++++++--------------------- src/layout/layout_network.c | 21 +++++++-------------- 3 files changed, 33 insertions(+), 37 deletions(-) diff --git a/include/define.h b/include/define.h index 01d4f5d..0612bd5 100644 --- a/include/define.h +++ b/include/define.h @@ -127,8 +127,8 @@ #define PART_POPUP_NAME "part.popup.name" -#define PART_POPUP_BOTTOM_BTN1 "part.popup.bottom.btn1" -#define PART_POPUP_BOTTOM_BTN2 "part.popup.bottom.btn2" +#define PART_WIFI_POPUP_BTN_CANCEL "part.popup.bottom.cancel" +#define PART_WIFI_POPUP_BTN_OK "part.popup.bottom.ok" #define PART_VIEW_BOTTOM_BTN1 "part.view.bottom.btn1" #define PART_VIEW_BOTTOM_BTN2 "part.view.bottom.btn2" diff --git a/res/layout/network.edc b/res/layout/network.edc index 7f455f6..982ae52 100644 --- a/res/layout/network.edc +++ b/res/layout/network.edc @@ -667,7 +667,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 0 24; + min, 0 20; rel1.to, "area"; rel2 { to, "area"; @@ -684,7 +684,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 0 32; + min, 0 24; rel1 { to, "padding.title"; relative, 0.0 1.0; @@ -695,7 +695,7 @@ group { color, COLOR_TEXT_POPUP; text { font, FONT_LIGHT; - size, 32; + size, 24; } } } @@ -706,7 +706,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 0 32; + min, 0 20; rel1 { to, PART_WIFI_NAME; relative, 0.0 1.0; @@ -723,7 +723,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 488 68; + min, 460 58; rel1 { to, "padding.passcode"; relative, 0.5 1.0; @@ -821,7 +821,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 20 0; + min, 8 0; rel1.to, "padding.passcode.area"; rel2 { to, "padding.passcode.area"; @@ -838,7 +838,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 34 0; + min, 8 0; rel1 { to, "padding.passcode.area"; relative, 1.0 0.0; @@ -863,13 +863,13 @@ group { to, "padding.passcode.right"; relative, 0.0 1.0; } - fixed, 1 1; + fixed, 0 1; } } -/* //////////////////////////////////////////////////////////// +/* //////////////////////////////////////////////////////////// */ part { name, "padding.error_msg.top"; type, SPACER; @@ -878,7 +878,7 @@ group { state, "default" 0.0; align, 0.0 0.0; fixed, 0 1; - min, 0 28; + min, 0 20; rel1 { relative, 0.0 1.0; to, "padding.passcode.area"; @@ -897,7 +897,7 @@ group { state, "default" 0.0; align, 0.0 0.0; fixed, 0 1; - min, 0 26; + min, 0 24; color, 240 62 62 255; rel1 { relative, 0.0 1.0; @@ -907,9 +907,9 @@ group { to, "padding.error_msg.top"; } text { - text, "Wrong Password"; + text, ""; font, FONT_LIGHT; - size, 26; + size, 24; } } } @@ -922,7 +922,7 @@ group { state, "default" 0.0; align, 0.0 0.0; fixed, 0 1; - min, 0 32; + min, 0 20; rel1 { relative, 0.0 1.0; to, "part.error_msg"; @@ -934,27 +934,28 @@ group { } part { - name, PART_WIFI_POPUP_BTN_CANCEL; + name, "part.popup.bottom.cancel"; type, SWALLOW; scale, 1; description { state, "default" 0.0; align, 0.0 0.0; fixed, 0 1; - min, 0 90; + min, 0 40; + color: 0 255 0 255; rel1 { relative, 0.0 1.0; to, "padding.error_msg.bottom"; } rel2 { - relative, 0.5 1.0; + relative, 0.475 1.0; to, "padding.error_msg.bottom"; } } } part { - name, PART_WIFI_POPUP_BTN_OK; + name, "part.popup.bottom.ok"; type, SWALLOW; scale, 1; repeat_events, 1; @@ -962,9 +963,11 @@ group { state, "default" 0.0; align, 0.0 0.0; fixed, 0 1; - min, 0 90; + color: 255 0 0 255; + min, 0 40; + visible: 1; rel1 { - relative, 0.5 1.0; + relative, 0.525 1.0; to, "padding.error_msg.bottom"; } rel2 { @@ -972,7 +975,7 @@ group { } } } -//////////////////////////////////////////////////////////// */ +/*//////////////////////////////////////////////////////////// */ } } diff --git a/src/layout/layout_network.c b/src/layout/layout_network.c index 4ffa3da..63a1328 100644 --- a/src/layout/layout_network.c +++ b/src/layout/layout_network.c @@ -719,19 +719,12 @@ static void _remove_wifi_passcode_popup(struct _priv *priv) return; } - if (priv->popup_btn1) { - inputmgr_remove_callback(priv->popup_btn1, &_popup_input_handler); - evas_object_del(priv->popup_btn1); - priv->popup_btn1 = NULL; - } - if (priv->popup_btn2) { - inputmgr_remove_callback(priv->popup_btn2, &_popup_input_handler); - evas_object_del(priv->popup_btn2); - priv->popup_btn2 = NULL; - } + inputmgr_remove_callback(priv->popup_btn1, &_popup_input_handler); + inputmgr_remove_callback(priv->popup_btn2, &_popup_input_handler); + elm_entry_input_panel_enabled_set(priv->passcode_entry, EINA_FALSE); - elm_object_focus_set(priv->passcode_entry, EINA_FALSE); - evas_object_del(priv->passcode_entry); + priv->popup_btn1 = NULL; + priv->popup_btn2 = NULL; priv->passcode_entry = NULL; evas_object_del(priv->passcode_popup); @@ -774,14 +767,14 @@ static bool _draw_wifi_passcode_popup(struct _priv *priv, char *wifi_name) elm_object_content_set(popup, ly); - btn1 = utils_add_button(popup, PART_POPUP_BOTTOM_BTN1, NULL, STR_CANCEL); + btn1 = utils_add_button(ly, PART_WIFI_POPUP_BTN_CANCEL, NULL, STR_CANCEL); if (!btn1) { _ERR("Add button failed."); evas_object_del(popup); return false; } - btn2 = utils_add_button(popup, PART_POPUP_BOTTOM_BTN2, NULL, STR_OK); + btn2 = utils_add_button(ly, PART_WIFI_POPUP_BTN_OK, NULL, STR_OK); if (!btn2) { _ERR("Add button failed."); evas_object_del(popup); -- 2.7.4