summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUmesh Tanwar <umesh.tanwar@samsung.com>2015-08-28 20:40:43 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-08-28 20:40:43 +0900
commit4298e69a26398308bdcc55dbaa4dccade4e609d4 (patch)
treea3f1a2c39c3c2c553c72ca3a5b5570422510c954
parent1cda2d76d8db1c083379ab83493942b0aa09a28e (diff)
Scroller: Scroll indicatin arrows should be enable if loop is set.
Summary: When loop is set, the arrows on horizontal/vertical bar should not be disabled. These arrows show the scrollable direction, if enabled. Disabled arrows show no more scroll in that direction. Signed-off-by: Umesh Tanwar <umesh.tanwar@samsung.com> Merge branch 'master' of http://git.enlightenment.org/core/elementary Test Plan: elementary_test -> scroller -> loop in x axis. Reviewers: raster, Hermet, singh.amitesh Subscribers: sachin.dev, SanghyeonLee, eagleeye Differential Revision: https://phab.enlightenment.org/D2953
-rw-r--r--data/themes/edc/elm/scroller.edc37
-rw-r--r--src/lib/elm_interface_scrollable.c10
2 files changed, 43 insertions, 4 deletions
diff --git a/data/themes/edc/elm/scroller.edc b/data/themes/edc/elm/scroller.edc
index 2f3d699cc..34fa9103c 100644
--- a/data/themes/edc/elm/scroller.edc
+++ b/data/themes/edc/elm/scroller.edc
@@ -38,13 +38,14 @@ group { name: "elm/scroller/base/default";
38 data.item: "focus_highlight" "on"; 38 data.item: "focus_highlight" "on";
39 39
40 script { 40 script {
41 public loop_x, loop_y;
41 public action_on_pos_vbar(val) { 42 public action_on_pos_vbar(val) {
42 new x, y , w, h, x1, y1 , w1, h1; 43 new x, y , w, h, x1, y1 , w1, h1;
43 44
44 get_geometry(PART:"y_vbar_up", x,y,w, h); 45 get_geometry(PART:"y_vbar_up", x,y,w, h);
45 get_geometry(PART:"y_vbar_up_mapper", x1,y1,w1, h1); 46 get_geometry(PART:"y_vbar_up_mapper", x1,y1,w1, h1);
46 47
47 if((y1 <= y) && (y <= (y1 + h1))) 48 if(((y1 <= y) && (y <= (y1 + h1))) && (0 == get_int(loop_y)))
48 { 49 {
49 set_state(PART:"arrow1_vbar", "hidden", 0.0); 50 set_state(PART:"arrow1_vbar", "hidden", 0.0);
50 set_state(PART:"sb_vbar_a1", "hidden", 0.0); 51 set_state(PART:"sb_vbar_a1", "hidden", 0.0);
@@ -58,7 +59,7 @@ group { name: "elm/scroller/base/default";
58 get_geometry(PART:"y_vbar_down", x,y,w, h); 59 get_geometry(PART:"y_vbar_down", x,y,w, h);
59 get_geometry(PART:"y_vbar_down_mapper", x1,y1,w1, h1); 60 get_geometry(PART:"y_vbar_down_mapper", x1,y1,w1, h1);
60 61
61 if((y1 <= (y + h)) && ((y+ h) <= (y1 + h1))) 62 if(((y1 <= (y + h)) && ((y+ h) <= (y1 + h1))) && (0 == get_int(loop_y)))
62 { 63 {
63 set_state(PART:"arrow2_vbar", "hidden", 0.0); 64 set_state(PART:"arrow2_vbar", "hidden", 0.0);
64 set_state(PART:"sb_vbar_a2", "hidden", 0.0); 65 set_state(PART:"sb_vbar_a2", "hidden", 0.0);
@@ -79,7 +80,7 @@ group { name: "elm/scroller/base/default";
79 get_geometry(PART:"x_hbar_left", x,y,w, h); 80 get_geometry(PART:"x_hbar_left", x,y,w, h);
80 get_geometry(PART:"x_hbar_left_mapper", x1,y1,w1, h1); 81 get_geometry(PART:"x_hbar_left_mapper", x1,y1,w1, h1);
81 82
82 if((x1 <= x) && (x <= (x1 + w1))) 83 if(((x1 <= x) && (x <= (x1 + w1))) && (0 == get_int(loop_x)))
83 { 84 {
84 set_state(PART:"arrow1_hbar", "hidden", 0.0); 85 set_state(PART:"arrow1_hbar", "hidden", 0.0);
85 set_state(PART:"sb_hbar_a1", "hidden", 0.0); 86 set_state(PART:"sb_hbar_a1", "hidden", 0.0);
@@ -93,7 +94,7 @@ group { name: "elm/scroller/base/default";
93 get_geometry(PART:"x_hbar_right", x,y,w, h); 94 get_geometry(PART:"x_hbar_right", x,y,w, h);
94 get_geometry(PART:"x_hbar_right_mapper", x1,y1,w1, h1); 95 get_geometry(PART:"x_hbar_right_mapper", x1,y1,w1, h1);
95 96
96 if((x1 <= (x + w)) && ((x + w) <= (x1 + w1))) 97 if(((x1 <= (x + w)) && ((x + w) <= (x1 + w1))) && (0 == get_int(loop_x)))
97 { 98 {
98 set_state(PART:"arrow2_hbar", "hidden", 0.0); 99 set_state(PART:"arrow2_hbar", "hidden", 0.0);
99 set_state(PART:"sb_hbar_a2", "hidden", 0.0); 100 set_state(PART:"sb_hbar_a2", "hidden", 0.0);
@@ -387,6 +388,20 @@ group { name: "elm/scroller/base/default";
387 action_on_pos_vbar(10); 388 action_on_pos_vbar(10);
388 } 389 }
389 } 390 }
391 program { name: "loop_set_vbar";
392 signal: "elm,loop_y,set"; source: "elm";
393 script {
394 set_int(loop_y, 1);
395 action_on_pos_vbar(10);
396 }
397 }
398 program { name: "loop_unset_vbar";
399 signal: "elm,loop_y,unset"; source: "elm";
400 script {
401 set_int(loop_y, 0);
402 action_on_pos_vbar(10);
403 }
404 }
390 405
391// horiz bar ///////////////////////////////////////////////////////////// 406// horiz bar /////////////////////////////////////////////////////////////
392 part { name: "sb_hbar_show"; type: RECT; 407 part { name: "sb_hbar_show"; type: RECT;
@@ -659,6 +674,20 @@ group { name: "elm/scroller/base/default";
659 action_on_pos_hbar(10); 674 action_on_pos_hbar(10);
660 } 675 }
661 } 676 }
677 program { name: "loop_set_hbar";
678 signal: "elm,loop_x,set"; source: "elm";
679 script {
680 set_int(loop_x, 1);
681 action_on_pos_hbar(10);
682 }
683 }
684 program { name: "loop_unset_hbar";
685 signal: "elm,loop_x,unset"; source: "elm";
686 script {
687 set_int(loop_x, 0);
688 action_on_pos_hbar(10);
689 }
690 }
662 part { name: "bg"; type: RECT; 691 part { name: "bg"; type: RECT;
663 description { state: "default" 0.0; 692 description { state: "default" 0.0;
664 rel1.to: "elm.swallow.background"; 693 rel1.to: "elm.swallow.background";
diff --git a/src/lib/elm_interface_scrollable.c b/src/lib/elm_interface_scrollable.c
index 27a46c164..914fc9a03 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/src/lib/elm_interface_scrollable.c
@@ -4450,6 +4450,16 @@ _elm_interface_scrollable_loop_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Int
4450 4450
4451 sid->loop_h = loop_h; 4451 sid->loop_h = loop_h;
4452 sid->loop_v = loop_v; 4452 sid->loop_v = loop_v;
4453
4454 if(sid->loop_h)
4455 edje_object_signal_emit(sid->edje_obj, "elm,loop_x,set", "elm");
4456 else
4457 edje_object_signal_emit(sid->edje_obj, "elm,loop_x,unset", "elm");
4458
4459 if(sid->loop_v)
4460 edje_object_signal_emit(sid->edje_obj, "elm,loop_y,set", "elm");
4461 else
4462 edje_object_signal_emit(sid->edje_obj, "elm,loop_y,unset", "elm");
4453} 4463}
4454 4464
4455EOLIAN static void 4465EOLIAN static void