fix scaling issues on FHD and WVGA resolutions. 21/187121/1 accepted/tizen_4.0_unified tizen_4.0 accepted/tizen/4.0/unified/20180829.004523 submit/tizen_4.0/20180822.063857
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Fri, 17 Aug 2018 11:05:09 +0000 (13:05 +0200)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Mon, 20 Aug 2018 06:38:02 +0000 (08:38 +0200)
Use edje scaling factor to resize indicator window.
Do not use ELM_SCALE for fonts.

Change-Id: I76eae8b0299c1cbbed2c59607b5e7ea6d34fce23

src/main.c
src/modules/clock/clock.c

index 1d536d206d7989cd0ed758a15c84965af4547bdd..0c3b8b19a37d2a14f6516aabf4225b8671632d5a 100644 (file)
@@ -316,25 +316,30 @@ 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)
 {
        win_info *info = data;
 
        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);
-                       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);
-                       break;
-               default:
-                       _E("Unahandled rotation value");
-                       return;
+       case 0:
+       case 180:
+               _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, info->h);
+               evas_object_resize(info->win, info->land_w, info->h);
+               break;
+       default:
+               _E("Unahandled rotation value");
+               return;
        }
        info->angle = angle;
        // this line below is making indicator to appear, however there are some
@@ -430,8 +435,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))
@@ -449,7 +454,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);
 
index e89eb850e42ce38ddf10c8f321cb096dc78c6844..e75dec7d4c209ddca41a5e80b6ee2a31c4f5b45c 100644 (file)
@@ -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