Application layout corrections 83/58783/4
authorRadek Kintop <r.kintop@samsung.com>
Wed, 3 Feb 2016 10:25:49 +0000 (11:25 +0100)
committerRadek Kintop <r.kintop@samsung.com>
Wed, 3 Feb 2016 12:24:56 +0000 (04:24 -0800)
Change-Id: I5c856081d0f328106f503d7e25583b2c6761efe7
Signed-off-by: Radek Kintop <r.kintop@samsung.com>
12 files changed:
include/define.h
include/layout/network.h
res/settings-theme.edc
res/settings.edc
res/view/base.edc
res/widget/button.edc
src/common/listmgr.c
src/common/utils.c
src/layout/layout_network.c
src/layout/layout_system.c
src/main.c
src/view/view_base.c

index 5864d75..dfb3d68 100644 (file)
 
 /* Size */
 #define SIZE_STR 1024
-#define SIZE_MENU_BOX_PAD_H (40 + 40)
-#define SIZE_MENU_BOX_PAD_V 0
 #define SIZE_LIST_ITEM_X (488 + 26)
 #define SIZE_LIST_ITEM_Y (134 + 26)
 
 /* Transition */
 #define TRANSITION_FOCUS DECELERATE 0.20
 
-/* scale */
+/* scale and resolution */
 #define APP_BASE_SCALE      2.0
+#define BASE_RESOLUTION_X 1920.0
+#define BASE_RESOLUTION_Y 1080.0
 
 #endif /* __AIR_SETTINGS_DEFINE_H__ */
index c52cc18..f4ed348 100644 (file)
 /* Count */
 #define COUNT_NETWORK_TYPE 2
 
-/* Size */
-#define SIZE_NETWORK_CTXPOPUP_W 310
-#define SIZE_NETWORK_CTXPOPUP_H 114
-
 /* Image */
 #define IC_NETWORK_NOR_01_PNG "ic_network_nor_01.png"
 #define IC_NETWORK_NOR_02_PNG "ic_network_nor_02.png"
index bfbb15b..700ab98 100644 (file)
@@ -17,7 +17,7 @@
 #include "../include/define.h"
 
 collections {
-       base_scale: 2.0;
+       base_scale: APP_BASE_SCALE;
        #include "widget/button.edc"
        #include "widget/progressbar.edc"
        #include "widget/ctxpopup.edc"
index 687915f..7d4275a 100644 (file)
@@ -17,7 +17,7 @@
 #include "../include/define.h"
 
 collections {
-       base_scale: 2.0;
+       base_scale: APP_BASE_SCALE;
        #include "view/base.edc"
        #include "view/clock.edc"
        #include "view/location.edc"
index 8901372..b3efef1 100644 (file)
  * limitations under the License.
  */
 
+#define UPPER_BG_Y2 (184.0 / BASE_RESOLUTION_Y)
+
+#define TITLE_X1 (400.0 / BASE_RESOLUTION_X)
+#define TITLE_X2 ((BASE_RESOLUTION_X - 400.0) / BASE_RESOLUTION_X)
+#define TITLE_Y1 (44.0 / BASE_RESOLUTION_Y)
+#define TITLE_Y2 (TITLE_Y1 + 46.0 / BASE_RESOLUTION_Y)
+
+#define MENU_X1 (190.0 / BASE_RESOLUTION_X)
+#define MENU_X2 ((BASE_RESOLUTION_X - 190.0) / BASE_RESOLUTION_X)
+#define MENU_Y1 TITLE_Y2
+#define MENU_Y2 (MENU_Y1 + 94.0 / BASE_RESOLUTION_Y)
+
+
 group {
        name, GRP_VIEW_BASE;
        parts {
@@ -28,86 +41,52 @@ group {
                }
 
                part {
-                       name, "title.bg";
                        type, RECT;
-                       scale, 1;
                        description {
                                state, "default" 0.0;
                                color, 255 255 255 255;
-                               min, 0 184;
-                               rel2.relative, 1.0 0.0;
-                               align, 0.5 0.0;
-                               fixed, 0 1;
+                               rel1.relative, 0.0 0.0;
+                               rel2.relative, 1.0 UPPER_BG_Y2;
                        }
                }
 
                part {
-                       name, "padding.title";
-                       type, SPACER;
-                       scale, 1;
+                       name, "title.bg";
+                       type, RECT;
                        description {
                                state, "default" 0.0;
-                               min, 0 44;
-                               rel2.relative, 1.0 0.0;
-                               align, 0.5 0.0;
-                               fixed, 0 1;
+                               rel1.relative, TITLE_X1 TITLE_Y1;
+                               rel2.relative, TITLE_X2 TITLE_Y2;
                        }
-               }
 
-               part {
-                       name, PART_TOP_TITLE;
-                       type, TEXT;
-                       scale, 1;
-                       description {
-                               state, "default" 0.0;
-                               color, 51 51 51 255;
-                               min, 0 46;
-                               rel1 {
-                                       to, "padding.title";
-                                       relative, 0.0 1.0;
-                               }
-                               rel2.to, "padding.title";
-                               align, 0.5 0.0;
-                               fixed, 0 1;
-                               text {
-                                       font, FONT_REGULAR;
-                                       size, 46;
-                                       align, 0.5 0.5;
+                       part {
+                               name, PART_TOP_TITLE;
+                               type, TEXT;
+                               scale, 1;
+                               description {
+                                       state, "default" 0.0;
+                                       color, 51 51 51 255;
+                                       rel1.relative, 0.0 0.0;
+                                       rel2.relative, 1.0 1.0;
+                                       align, 0.5 0.0;
+                                       text {
+                                               font, FONT_REGULAR;
+                                               size, 46;
+                                               align, 0.5 0.5;
+                                       }
                                }
                        }
                }
 
                part {
-                       name, "padding.menu";
-                       type, SPACER;
-                       scale, 1;
-                       description {
-                               state, "default" 0.0;
-                               min, 0 12;
-                               rel1 {
-                                       to, PART_TOP_TITLE;
-                                       relative, 0.0 1.0;
-                               }
-                               rel2.to, PART_TOP_TITLE;
-                               fixed, 0 1;
-                               align, 0.5 0.0;
-                       }
-               }
-
-               part {
                        name, PART_MENU;
                        type, SWALLOW;
                        scale, 1;
                        description {
                                state, "default" 0.0;
-                               min, 0 82;
-                               rel1 {
-                                       to, "padding.menu";
-                                       relative, 0.0 1.0;
-                               }
-                               rel2.to, "padding.menu";
-                               fixed, 0 1;
-                               align, 0.5 0.0;
+                               color: 255 0 0 255;
+                               rel1.relative, 0.0 MENU_Y1;
+                               rel2.relative, 1.0 MENU_Y2;
                        }
                }
 
@@ -125,32 +104,6 @@ group {
                }
 
                part {
-                       name, "padding.text1";
-                       type, SPACER;
-                       scale, 1;
-                       description {
-                               state, "default" 0.0;
-                               min, 0 318;
-                               rel2.relative, 0.0 0.0;
-                               align, 0.5 0.0;
-                               fixed, 0 1;
-                       }
-               }
-
-               part {
-                       name, "padding.text2";
-                       type, SPACER;
-                       scale, 1;
-                       description {
-                               state, "default" 0.0;
-                               min, 0 148;
-                               rel1.relative, 1.0 1.0;
-                               align, 0.5 1.0;
-                               fixed, 0 1;
-                       }
-               }
-
-               part {
                        name, PART_TEXT;
                        type, TEXT;
                        scale, 1;
@@ -158,12 +111,10 @@ group {
                                state, "default" 0.0;
                                color, 0 0 0 178;
                                rel1 {
-                                       to, "padding.text1";
-                                       relative, 1.0 1.0;
+                                       relative, 0.0 0.5;
                                }
                                rel2 {
-                                       to, "padding.text2";
-                                       relative, 0.0 0.0;
+                                       relative, 1.0 1.0;
                                }
                                text {
                                        font, FONT_LIGHT;
index 2e5b25e..1ee1cbf 100644 (file)
@@ -113,7 +113,7 @@ group {
                                        font, FONT_REGULAR;
                                        size, 32;
                                        align, 0.5 0.5;
-                                       ellipsis, -1;
+                                       ellipsis, 1.0;
                                }
                        }
                        description {
index 7634c26..0433863 100644 (file)
@@ -274,6 +274,7 @@ bool listmgr_add_list(struct listmgr *listmgr, const char *list_id,
 
        if (!_add_grid(linfo, listmgr->parent, gclass)) {
                _ERR("Add grid failed.");
+               free(linfo->list_id);
                free(linfo);
                return false;
        }
index e18240e..f119d85 100644 (file)
@@ -24,7 +24,7 @@
 Evas_Object *utils_add_layout(Evas_Object *parent, const char *group,
                Eina_Bool win_resize)
 {
-       Evas_Object *ly;
+       Evas_Object *ly = NULL;
 
        if (!parent || !group) {
                _ERR("Invalid argument.");
@@ -38,11 +38,14 @@ Evas_Object *utils_add_layout(Evas_Object *parent, const char *group,
        }
 
        elm_layout_file_set(ly, EDJEFILE, group);
-       evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND,
-                       EVAS_HINT_EXPAND);
+       evas_object_move(ly, 0, 0);
 
-       if (win_resize)
-               elm_win_resize_object_add(parent, ly);
+       if (win_resize) {
+               int w = 0;
+               int h = 0;
+               evas_object_geometry_get(parent, NULL, NULL, &w, &h);
+               evas_object_resize(ly, w, h);
+       }
 
        return ly;
 }
@@ -50,7 +53,9 @@ Evas_Object *utils_add_layout(Evas_Object *parent, const char *group,
 Evas_Object *utils_add_box(Evas_Object *parent, const char *part,
                Eina_Bool horizontal, int pad_h, int pad_v)
 {
-       Evas_Object *box;
+       Evas_Object *box = NULL;
+       int w = 0;
+       int h = 0;
 
        if (!parent) {
                _ERR("Invalid argument.");
@@ -65,12 +70,13 @@ Evas_Object *utils_add_box(Evas_Object *parent, const char *part,
 
        elm_box_horizontal_set(box, horizontal);
        elm_box_padding_set(box, ELM_SCALE_SIZE(pad_h), ELM_SCALE_SIZE(pad_v));
-       evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND,
-                       EVAS_HINT_EXPAND);
-       evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
 
-       if (part)
+       if (part) {
                elm_object_part_content_set(parent, part, box);
+       } else {
+               evas_object_geometry_get(parent, NULL, NULL, &w, &h);
+               evas_object_resize(box, w, h);
+       }
 
        evas_object_show(box);
 
index 21bbf75..e6a7cb9 100644 (file)
@@ -177,11 +177,8 @@ static void _draw_network_type_popup(struct _priv *priv)
        }
 
        evas_object_geometry_get(priv->network_type_btn, &x, &y, &w, &h);
-       evas_object_move(ctxpopup,
-                       ELM_SCALE_SIZE(x + w / 2),
-                       ELM_SCALE_SIZE(y + h));
-       evas_object_size_hint_min_set(ctxpopup, ELM_SCALE_SIZE(SIZE_NETWORK_CTXPOPUP_W),
-                       ELM_SCALE_SIZE(SIZE_NETWORK_CTXPOPUP_H));
+       evas_object_move(ctxpopup, (x + w / 2), (y + h));
+       evas_object_size_hint_min_set(ctxpopup, w, 0);
 
        priv->network_type_popup = ctxpopup;
 
index 716cfe7..ab6c7eb 100644 (file)
@@ -490,7 +490,7 @@ static bool _create(layoutmgr *lmgr, void *data)
                return false;
        }
 
-       ly = utils_add_layout(base, GRP_LAYOUT_SYSTEM, EINA_FALSE);
+       ly = utils_add_layout(base, GRP_LAYOUT_SYSTEM, EINA_TRUE);
        if (!ly) {
                _ERR("Add layout failed.");
                return false;
index 607b018..fe0cdf2 100644 (file)
@@ -33,6 +33,8 @@ struct _appdata {
 
 static bool _create(void *data)
 {
+       int w = 0;
+       int h = 0;
        struct _appdata *ad;
        Evas_Object *win;
 
@@ -42,7 +44,6 @@ static bool _create(void *data)
        }
        ad = data;
 
-       elm_app_base_scale_set(APP_BASE_SCALE);
        elm_theme_overlay_add(NULL, THEMEFILE);
 
        win = elm_win_add(NULL, ad->name, ELM_WIN_BASIC);
@@ -51,6 +52,9 @@ static bool _create(void *data)
                return false;
        }
 
+       elm_win_screen_size_get(win, NULL, NULL, &w, &h);
+       evas_object_resize(win, w, h);
+
        elm_win_title_set(win, ad->name);
        elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
        evas_object_show(win);
index fa4b17d..871dc22 100644 (file)
@@ -172,8 +172,8 @@ static bool _draw_menu_area(struct _priv *priv)
 
        elm_object_part_text_set(priv->base, PART_TOP_TITLE, _(STR_SETTINGS));
 
-       box = utils_add_box(priv->base, PART_MENU, EINA_TRUE,
-                       SIZE_MENU_BOX_PAD_H, SIZE_MENU_BOX_PAD_V);
+       box = utils_add_box(priv->base, PART_MENU, EINA_TRUE, 1, 0);
+
        if (!box) {
                _ERR("Add box failed.");
                return false;