/* 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__ */
/* 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"
#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"
#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"
* 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 {
}
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;
}
}
}
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;
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;
font, FONT_REGULAR;
size, 32;
align, 0.5 0.5;
- ellipsis, -1;
+ ellipsis, 1.0;
}
}
description {
if (!_add_grid(linfo, listmgr->parent, gclass)) {
_ERR("Add grid failed.");
+ free(linfo->list_id);
free(linfo);
return false;
}
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.");
}
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;
}
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.");
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);
}
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;
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;
static bool _create(void *data)
{
+ int w = 0;
+ int h = 0;
struct _appdata *ad;
Evas_Object *win;
}
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);
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);
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;