From 1a216f744997429c22cf49e0b1b6dae6288673e3 Mon Sep 17 00:00:00 2001 From: Jagrat Patidar Date: Tue, 15 Dec 2020 17:52:26 +0530 Subject: [PATCH] This patch resolves issue of app icon going out of screen in portrait mode Change-Id: I97688299da3c06eb5f602dbc693c7a1f2304f033 --- src/apps_view.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/apps_view.c b/src/apps_view.c index c70d9b2..b3dda18 100644 --- a/src/apps_view.c +++ b/src/apps_view.c @@ -34,6 +34,8 @@ #define MAX_BADGE_COUNT_STR_LEN 5 #define MAX_BADGE_DISPLAY_COUNT 999 +#define APPS_VIEW_CONST_W 0.92 +#define APPS_VIEW_CONST_H 0.7625 #define MAP_BUF 0 @@ -557,19 +559,12 @@ bool apps_view_icon_set(app_data_t *item) __D("%s %d %d", item->app_id, item->parent_db_id, item->position); if (item->parent_db_id == APPS_ROOT) { page_index = item->position / (APPS_VIEW_COL*APPS_VIEW_ROW); - if (_COMMON) { - w = 240; - h = 192; - row = (item->position / APPS_VIEW_COL_COMMON) % APPS_VIEW_ROW_COMMON; - col = item->position % APPS_VIEW_COL_COMMON; - } else { - w = APPS_VIEW_W / APPS_VIEW_COL; - h = APPS_VIEW_H / APPS_VIEW_ROW; - row = (item->position / 5) % 3; - col = item->position % 5; - } - w = APPS_VIEW_ICON_CONTENT_HORIZONTAL_DISTANCE; - h = APPS_VIEW_ICON_CONTENT_VERTICAL_DISTANCE; + row = (item->position / APPS_VIEW_COL_COMMON) % APPS_VIEW_ROW_COMMON; + col = item->position % APPS_VIEW_COL_COMMON; + + w = (APPS_VIEW_W * APPS_VIEW_CONST_W) / APPS_VIEW_COL_COMMON; + h = (APPS_VIEW_H * APPS_VIEW_CONST_H) / APPS_VIEW_ROW_COMMON; + x = APPS_VIEW_W * 0.083 + col * w; y = APPS_VIEW_PADDING_TOP + APPS_VIEW_H * 0.127 + row * h; if (eina_list_count(apps_view_s.page_list) < page_index+1) { @@ -578,7 +573,6 @@ bool apps_view_icon_set(app_data_t *item) page = eina_list_nth(apps_view_s.page_list, page_index); - grid = elm_object_part_content_get(page, APPS_VIEW_GRID); elm_grid_pack(grid, item->app_layout, x, y, APPS_VIEW_ICON_CONTENT_WIDTH, APPS_VIEW_ICON_CONTENT_HEIGHT); -- 2.7.4