summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-09-13 11:56:16 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-09-13 11:56:16 +0000
commit185c6e502b6780e0268e7e4d78aa294bac69c150 (patch)
tree7e67a02be55ffc91e0a49c71e47bd0ee259e3db2
parentfe59af6fa708de74cd083b566ebc1f7479f246a1 (diff)
backport diskselector fix
SVN revision: 76607
-rw-r--r--ChangeLog4
-rw-r--r--NEWS5
-rw-r--r--src/lib/elm_diskselector.c48
-rw-r--r--src/lib/elm_widget_diskselector.h2
4 files changed, 47 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 99c99b00b..23805dca9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -435,3 +435,7 @@
4352012-09-12 Thiep Ha 4352012-09-12 Thiep Ha
436 436
437 * Fix ctxpopup direction if -1 is uses as priority. 437 * Fix ctxpopup direction if -1 is uses as priority.
438
4392012-09-13 Prince Kumar Dubey
440
441 * Fix diskselector when bounce off and round enabled.
diff --git a/NEWS b/NEWS
index 78116ddfc..62e24901c 100644
--- a/NEWS
+++ b/NEWS
@@ -8,8 +8,9 @@ Fixes:
8 * Now elm_datetime_field_limit_set() can set year limits wihtout problems. 8 * Now elm_datetime_field_limit_set() can set year limits wihtout problems.
9 * Fix re-order animation when iot doesn't end correctly. 9 * Fix re-order animation when iot doesn't end correctly.
10 * Fix popup to apply the same style to the notify sub-widget. 10 * Fix popup to apply the same style to the notify sub-widget.
11 * Fix Ctxpopup direction if -1 priority used 11 * Fix Ctxpopup direction if unknown priority used
12 12 * Fix diskselector when bounce off and round enabled.
13
13Changes since Elementary 1.0.0: 14Changes since Elementary 1.0.0:
14------------------------- 15-------------------------
15 16
diff --git a/src/lib/elm_diskselector.c b/src/lib/elm_diskselector.c
index 1b0968615..83de9b7d7 100644
--- a/src/lib/elm_diskselector.c
+++ b/src/lib/elm_diskselector.c
@@ -839,7 +839,9 @@ static void
839_scroll_cb(Evas_Object *obj, 839_scroll_cb(Evas_Object *obj,
840 void *data __UNUSED__) 840 void *data __UNUSED__)
841{ 841{
842 Evas_Coord x, y, w, h, bw; 842 Evas_Coord x, y, w, h, bw, x_boundary;
843 unsigned int adjust_pixels;
844 Eina_Bool h_bounce;
843 845
844 ELM_DISKSELECTOR_DATA_GET(obj, sd); 846 ELM_DISKSELECTOR_DATA_GET(obj, sd);
845 847
@@ -849,15 +851,41 @@ _scroll_cb(Evas_Object *obj,
849 if (sd->round) 851 if (sd->round)
850 { 852 {
851 evas_object_geometry_get(sd->main_box, NULL, NULL, &bw, NULL); 853 evas_object_geometry_get(sd->main_box, NULL, NULL, &bw, NULL);
852 if (x > ((w / sd->display_item_num) * (sd->item_count 854 x_boundary = bw - w;
853 + (sd->display_item_num % 2)))) 855
854 sd->s_iface->content_region_show 856 if (x >= x_boundary)
855 (obj, x - ((w / sd->display_item_num) * sd->item_count), 857 {
856 y, w, h); 858 if (sd->left_boundary_reached) return;
857 else if (x < 0) 859
858 sd->s_iface->content_region_show 860 sd->right_boundary_reached = EINA_TRUE;
859 (obj, x + ((w / sd->display_item_num) * sd->item_count), 861 sd->s_iface->bounce_allow_get(obj, &h_bounce, NULL);
860 y, w, h); 862 /* If scroller's bounce effect is disabled, add 1 pixel
863 * to provide circular effect */
864 adjust_pixels = (_elm_config->thumbscroll_bounce_enable
865 && h_bounce) ? 0 : 1;
866 sd->s_iface->content_region_show
867 (obj, x - x_boundary + adjust_pixels, y, w, h);
868 sd->left_boundary_reached = EINA_FALSE;
869 }
870 else if (x <= 0)
871 {
872 if (sd->right_boundary_reached) return;
873
874 sd->left_boundary_reached = EINA_TRUE;
875 sd->s_iface->bounce_allow_get(obj, &h_bounce, NULL);
876 /* If scroller's bounce effect is disabled, subtract 1 pixel
877 * to provide circular effect */
878 adjust_pixels = (_elm_config->thumbscroll_bounce_enable
879 && h_bounce) ? 0 : 1;
880 sd->s_iface->content_region_show
881 (obj, x + x_boundary - adjust_pixels, y, w, h);
882 sd->right_boundary_reached = EINA_FALSE;
883 }
884 else
885 {
886 sd->left_boundary_reached = EINA_FALSE;
887 sd->right_boundary_reached = EINA_FALSE;
888 }
861 } 889 }
862} 890}
863 891
diff --git a/src/lib/elm_widget_diskselector.h b/src/lib/elm_widget_diskselector.h
index 30d92c428..6a21cd4d3 100644
--- a/src/lib/elm_widget_diskselector.h
+++ b/src/lib/elm_widget_diskselector.h
@@ -151,6 +151,8 @@ struct _Elm_Diskselector_Smart_Data
151 Eina_Bool init : 1; 151 Eina_Bool init : 1;
152 Eina_Bool round : 1; 152 Eina_Bool round : 1;
153 Eina_Bool display_item_num_by_api : 1; 153 Eina_Bool display_item_num_by_api : 1;
154 Eina_Bool left_boundary_reached:1;
155 Eina_Bool right_boundary_reached:1;
154}; 156};
155 157
156struct _Elm_Diskselector_Item 158struct _Elm_Diskselector_Item