From: aman.jeph Date: Tue, 6 Oct 2020 11:44:36 +0000 (+0530) Subject: [TIZENIOT-1794] Correcting slider event area calculation for minicontroller X-Git-Tag: submit/tizen/20201008.090133~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da36b56a6015168175fc8d29a90c4dfc40d66e80;p=profile%2Fiot%2Fapps%2Fnative%2Fquickpanel.git [TIZENIOT-1794] Correcting slider event area calculation for minicontroller Change-Id: Ibad67d0af4e9d3dc45a35ce6a4cc28bebe4d030d Signed-off-by: aman.jeph --- diff --git a/src/minictrl/minictrl.c b/src/minictrl/minictrl.c index b528897..ef60177 100755 --- a/src/minictrl/minictrl.c +++ b/src/minictrl/minictrl.c @@ -57,10 +57,12 @@ #define MINCONTROL_CONTAINER_SWALLOW "mini_ctrl.swallow" //SLIDER AREA -#define SLIDER_START_W 790 -#define SLIDER_END_W 1160 -#define SLIDER_START_H 400 -#define SLIDER_END_H 432 +#define SLIDER_START_W 790 // start postion of slider with respect to window +#define SLIDER_END_W 1160 // end position of slider with respect to window +#define SLIDER_EVENT_AREA 32 +#define SLIDER_LAYOUT_HEIGHT 112 +#define SLIDER_START_H_OFFSET (((SLIDER_LAYOUT_HEIGHT) - (SLIDER_EVENT_AREA))/2) // offset for slider height start with respect to viewer layout +#define SLIDER_END_H_OFFSET (SLIDER_START_H_OFFSET + SLIDER_EVENT_AREA) // offset for slider height end with respect to viewer layout //Max Size of Mini-Controller #define MINICONTROL_MAX_WIDTH 1200 @@ -242,8 +244,17 @@ static void _mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_in * co-ordinate provided by the mouse event are relative to window/screen. * if position of slider object is changed than we need to update slider area accordingly. */ + int x = 0, y = 0, w = 0, h = 0; + evas_object_geometry_get(obj, &x, &y, &w, &h); + DBG("Viewer [X: %d] [Y: %d] [W: %d] [H: %d]", x, y, w, h); + DBG("Mouse click [X: %d] [Y: %d]", ev->canvas.x, ev->canvas.y); + + int slider_start_h = y + SLIDER_START_H_OFFSET; + int slider_end_h = y + SLIDER_END_H_OFFSET; + + DBG("Height range: [start: %d] [end: %d]", slider_start_h, slider_end_h); - if(ev->canvas.x >= SLIDER_START_W && ev->canvas.x <= SLIDER_END_W && ev->canvas.y >= SLIDER_START_H && ev->canvas.y <= SLIDER_END_H) + if(ev->canvas.x >= SLIDER_START_W && ev->canvas.x <= SLIDER_END_W && ev->canvas.y >= slider_start_h && ev->canvas.y <= slider_end_h) { s_info.mouse_event_blocker = EINA_TRUE; elm_object_scroll_freeze_push(ad->scroller);