From: Lukasz Stanislawski Date: Fri, 17 Aug 2018 11:05:09 +0000 (+0200) Subject: fix scaling issues on FHD and WVGA resolutions. X-Git-Tag: accepted/tizen/5.0/unified/20181106.202656^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cad86e974642baa3f367fc20bebf7e6f6242f0c1;p=profile%2Fmobile%2Fapps%2Fnative%2Findicator.git fix scaling issues on FHD and WVGA resolutions. Use edje scaling factor to resize indicator window. Do not use ELM_SCALE for fonts. Change-Id: I76eae8b0299c1cbbed2c59607b5e7ea6d34fce23 --- diff --git a/src/main.c b/src/main.c index f9996fc..635af56 100644 --- a/src/main.c +++ b/src/main.c @@ -314,6 +314,11 @@ static Eina_Bool _render_force(void *data) return EINA_FALSE; } +static int _indicator_height_calculate() +{ + return (int)(round(INDICATOR_HEIGHT * edje_scale_get() / elm_app_base_scale_get())); +} + static void _indicator_service_cb(void *data, tzsh_indicator_service_h service, int angle, int opacity) { @@ -322,13 +327,13 @@ static void _indicator_service_cb(void *data, tzsh_indicator_service_h service, switch (angle) { case 0: case 180: - _D("Enable indicator portrait mode: %d %d", info->port_w, INDICATOR_HEIGHT); - evas_object_resize(info->win, info->port_w, INDICATOR_HEIGHT); + _D("Enable indicator portrait mode: %d %d", info->port_w, info->h); + evas_object_resize(info->win, info->port_w, info->h); break; case 90: case 270: - _D("Enable indicator landscape mode: %d %d", info->land_w, INDICATOR_HEIGHT); - evas_object_resize(info->win, info->land_w, INDICATOR_HEIGHT); + _D("Enable indicator landscape mode: %d %d", info->land_w, info->h); + evas_object_resize(info->win, info->land_w, info->h); break; default: _E("Unahandled rotation value"); @@ -427,8 +432,8 @@ static void _create_window(struct appdata *ad) evas_object_size_hint_fill_set(ad->win.win , EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ad->win.win , 1.0, 0.5); - evas_object_resize(ad->win.win, ad->win.port_w, INDICATOR_HEIGHT); - _D("w,h(%d,%d)", ad->win.port_w, INDICATOR_HEIGHT); + evas_object_resize(ad->win.win, ad->win.port_w, ad->win.h); + _D("w,h(%d,%d)", ad->win.port_w, ad->win.h); evas_object_show(ad->win.win); if (indicator_tzsh_init(&ad->win)) @@ -446,7 +451,7 @@ static void _create_base_gui(void* data) _create_window(ad); /* FIXME */ - ad->win.h = INDICATOR_HEIGHT; + ad->win.h = _indicator_height_calculate(); ad->win.w = ad->win.port_w; ad->win.evas = evas_object_evas_get(ad->win.win); diff --git a/src/modules/clock/clock.c b/src/modules/clock/clock.c index e89eb85..e75dec7 100644 --- a/src/modules/clock/clock.c +++ b/src/modules/clock/clock.c @@ -32,9 +32,9 @@ #define SYSTEM_RESUME "system_wakeup" -#define TIME_FONT_SIZE_24 ELM_SCALE_SIZE(30) -#define TIME_FONT_SIZE_12 ELM_SCALE_SIZE(30) -#define AMPM_FONT_SIZE ELM_SCALE_SIZE(29) +#define TIME_FONT_SIZE_24 30 +#define TIME_FONT_SIZE_12 30 +#define AMPM_FONT_SIZE 29 #define TIME_FONT_COLOR 200, 200, 200, 255 #define AMPM_FONT_COLOR 200, 200, 200, 255