forked from enlightenment/efl
From: PRINCE KUMAR DUBEY <prince.dubey@samsung.com>
Subject: [E-devel] [Patch] [Elementary] Support for circular effect in elm_diskselector, in case scroller's bounce effect is disabled. Can someone please review the attached patch created by Sumanth. [Issue Details] : elm_diskselector_round_enable_set() API is not working, if elm_scroller's bounce effect is disabled. [Root cause] : For diskselector circular effect, the boundary checking is done based on scroller's geometry. If bouncing effect is disabled in elm_scroller, its geometry can lie between 0 on left and CHILD_SIZE on right but it can never go beyond that point. Unless the scroller's geometry goes beyond its child (here, elm_box) size, diskselector cann't trigger the circular effect. [Change Description] : For diskselector items circular effect, the boundary checking is performed at the left/right edges of its child, elm_box. Once the scroller reaches to the left/right edge of box or goes beyond that point, circular effect will be triggered. SVN revision: 76606
This commit is contained in:
parent
0fb69c0e37
commit
bc2a1bd996
|
@ -481,3 +481,7 @@
|
||||||
2012-09-12 Davide Andreoli (davemds)
|
2012-09-12 Davide Andreoli (davemds)
|
||||||
|
|
||||||
* Add external property "play length" to Video widget, read-only.
|
* Add external property "play length" to Video widget, read-only.
|
||||||
|
|
||||||
|
2012-09-13 Prince Kumar Dubey
|
||||||
|
|
||||||
|
* Fix diskselector when bounce off and round enabled.
|
||||||
|
|
|
@ -23,7 +23,8 @@ Fixes:
|
||||||
* Now elm_datetime_field_limit_set() can set year limits wihtout problems.
|
* Now elm_datetime_field_limit_set() can set year limits wihtout problems.
|
||||||
* Fix re-order animation when it doesn't end correctly.
|
* Fix re-order animation when it doesn't end correctly.
|
||||||
* Fix popup to apply the same style to the notify sub-widget.
|
* Fix popup to apply the same style to the notify sub-widget.
|
||||||
* Fix Ctxpopup direction if -1 priority used
|
* Fix Ctxpopup direction if unknown priority used.
|
||||||
|
* Fix diskselector when bounce off and round enabled.
|
||||||
|
|
||||||
Removals:
|
Removals:
|
||||||
|
|
||||||
|
|
|
@ -848,7 +848,9 @@ static void
|
||||||
_scroll_cb(Evas_Object *obj,
|
_scroll_cb(Evas_Object *obj,
|
||||||
void *data __UNUSED__)
|
void *data __UNUSED__)
|
||||||
{
|
{
|
||||||
Evas_Coord x, y, w, h, bw;
|
Evas_Coord x, y, w, h, bw, x_boundary;
|
||||||
|
unsigned int adjust_pixels;
|
||||||
|
Eina_Bool h_bounce;
|
||||||
|
|
||||||
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
ELM_DISKSELECTOR_DATA_GET(obj, sd);
|
||||||
|
|
||||||
|
@ -858,15 +860,41 @@ _scroll_cb(Evas_Object *obj,
|
||||||
if (sd->round)
|
if (sd->round)
|
||||||
{
|
{
|
||||||
evas_object_geometry_get(sd->main_box, NULL, NULL, &bw, NULL);
|
evas_object_geometry_get(sd->main_box, NULL, NULL, &bw, NULL);
|
||||||
if (x > ((w / sd->display_item_num) * (sd->item_count
|
x_boundary = bw - w;
|
||||||
+ (sd->display_item_num % 2))))
|
|
||||||
sd->s_iface->content_region_show
|
if (x >= x_boundary)
|
||||||
(obj, x - ((w / sd->display_item_num) * sd->item_count),
|
{
|
||||||
y, w, h);
|
if (sd->left_boundary_reached) return;
|
||||||
else if (x < 0)
|
|
||||||
sd->s_iface->content_region_show
|
sd->right_boundary_reached = EINA_TRUE;
|
||||||
(obj, x + ((w / sd->display_item_num) * sd->item_count),
|
sd->s_iface->bounce_allow_get(obj, &h_bounce, NULL);
|
||||||
y, w, h);
|
/* If scroller's bounce effect is disabled, add 1 pixel
|
||||||
|
* to provide circular effect */
|
||||||
|
adjust_pixels = (_elm_config->thumbscroll_bounce_enable
|
||||||
|
&& h_bounce) ? 0 : 1;
|
||||||
|
sd->s_iface->content_region_show
|
||||||
|
(obj, x - x_boundary + adjust_pixels, y, w, h);
|
||||||
|
sd->left_boundary_reached = EINA_FALSE;
|
||||||
|
}
|
||||||
|
else if (x <= 0)
|
||||||
|
{
|
||||||
|
if (sd->right_boundary_reached) return;
|
||||||
|
|
||||||
|
sd->left_boundary_reached = EINA_TRUE;
|
||||||
|
sd->s_iface->bounce_allow_get(obj, &h_bounce, NULL);
|
||||||
|
/* If scroller's bounce effect is disabled, subtract 1 pixel
|
||||||
|
* to provide circular effect */
|
||||||
|
adjust_pixels = (_elm_config->thumbscroll_bounce_enable
|
||||||
|
&& h_bounce) ? 0 : 1;
|
||||||
|
sd->s_iface->content_region_show
|
||||||
|
(obj, x + x_boundary - adjust_pixels, y, w, h);
|
||||||
|
sd->right_boundary_reached = EINA_FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sd->left_boundary_reached = EINA_FALSE;
|
||||||
|
sd->right_boundary_reached = EINA_FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -151,6 +151,8 @@ struct _Elm_Diskselector_Smart_Data
|
||||||
Eina_Bool init : 1;
|
Eina_Bool init : 1;
|
||||||
Eina_Bool round : 1;
|
Eina_Bool round : 1;
|
||||||
Eina_Bool display_item_num_by_api : 1;
|
Eina_Bool display_item_num_by_api : 1;
|
||||||
|
Eina_Bool left_boundary_reached:1;
|
||||||
|
Eina_Bool right_boundary_reached:1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Elm_Diskselector_Item
|
struct _Elm_Diskselector_Item
|
||||||
|
|
Loading…
Reference in New Issue