hermet pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=4298e69a26398308bdcc55dbaa4dccade4e609d4

commit 4298e69a26398308bdcc55dbaa4dccade4e609d4
Author: Umesh Tanwar <umesh.tan...@samsung.com>
Date:   Fri Aug 28 20:40:43 2015 +0900

    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.tan...@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
---
 data/themes/edc/elm/scroller.edc   | 37 +++++++++++++++++++++++++++++++++----
 src/lib/elm_interface_scrollable.c | 10 ++++++++++
 2 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/data/themes/edc/elm/scroller.edc b/data/themes/edc/elm/scroller.edc
index 2f3d699..34fa910 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";
    data.item: "focus_highlight" "on";
 
    script {
+      public loop_x, loop_y;
       public action_on_pos_vbar(val) {
          new x, y , w, h, x1, y1 , w1, h1;
 
          get_geometry(PART:"y_vbar_up", x,y,w, h);
          get_geometry(PART:"y_vbar_up_mapper", x1,y1,w1, h1);
 
-         if((y1 <= y) && (y <= (y1 + h1)))
+         if(((y1 <= y) && (y <= (y1 + h1))) && (0 == get_int(loop_y)))
          {
             set_state(PART:"arrow1_vbar", "hidden", 0.0);
             set_state(PART:"sb_vbar_a1", "hidden", 0.0);
@@ -58,7 +59,7 @@ group { name: "elm/scroller/base/default";
          get_geometry(PART:"y_vbar_down", x,y,w, h);
          get_geometry(PART:"y_vbar_down_mapper", x1,y1,w1, h1);
 
-         if((y1 <= (y + h)) && ((y+ h) <= (y1 + h1)))
+         if(((y1 <= (y + h)) && ((y+ h) <= (y1 + h1))) && (0 == 
get_int(loop_y)))
          {
             set_state(PART:"arrow2_vbar", "hidden", 0.0);
             set_state(PART:"sb_vbar_a2", "hidden", 0.0);
@@ -79,7 +80,7 @@ group { name: "elm/scroller/base/default";
          get_geometry(PART:"x_hbar_left", x,y,w, h);
          get_geometry(PART:"x_hbar_left_mapper", x1,y1,w1, h1);
 
-         if((x1 <= x) && (x <= (x1 + w1)))
+         if(((x1 <= x) && (x <= (x1 + w1))) && (0 == get_int(loop_x)))
          {
             set_state(PART:"arrow1_hbar", "hidden", 0.0);
             set_state(PART:"sb_hbar_a1", "hidden", 0.0);
@@ -93,7 +94,7 @@ group { name: "elm/scroller/base/default";
          get_geometry(PART:"x_hbar_right", x,y,w, h);
          get_geometry(PART:"x_hbar_right_mapper", x1,y1,w1, h1);
 
-         if((x1 <= (x + w)) && ((x + w) <= (x1 + w1)))
+         if(((x1 <= (x + w)) && ((x + w) <= (x1 + w1))) && (0 == 
get_int(loop_x)))
          {
             set_state(PART:"arrow2_hbar", "hidden", 0.0);
             set_state(PART:"sb_hbar_a2", "hidden", 0.0);
@@ -387,6 +388,20 @@ group { name: "elm/scroller/base/default";
             action_on_pos_vbar(10);
          }
       }
+      program { name: "loop_set_vbar";
+         signal: "elm,loop_y,set"; source: "elm";
+         script {
+            set_int(loop_y, 1);
+            action_on_pos_vbar(10);
+         }
+      }
+      program { name: "loop_unset_vbar";
+         signal: "elm,loop_y,unset"; source: "elm";
+         script {
+            set_int(loop_y, 0);
+            action_on_pos_vbar(10);
+         }
+      }
 
 // horiz bar /////////////////////////////////////////////////////////////
       part { name: "sb_hbar_show"; type: RECT;
@@ -659,6 +674,20 @@ group { name: "elm/scroller/base/default";
             action_on_pos_hbar(10);
          }
       }
+      program { name: "loop_set_hbar";
+         signal: "elm,loop_x,set"; source: "elm";
+         script {
+            set_int(loop_x, 1);
+            action_on_pos_hbar(10);
+         }
+      }
+      program { name: "loop_unset_hbar";
+         signal: "elm,loop_x,unset"; source: "elm";
+         script {
+            set_int(loop_x, 0);
+            action_on_pos_hbar(10);
+         }
+      }
       part { name: "bg"; type: RECT;
          description { state: "default" 0.0;
             rel1.to: "elm.swallow.background";
diff --git a/src/lib/elm_interface_scrollable.c 
b/src/lib/elm_interface_scrollable.c
index 27a46c1..914fc9a 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
 
    sid->loop_h = loop_h;
    sid->loop_v = loop_v;
+
+   if(sid->loop_h)
+     edje_object_signal_emit(sid->edje_obj, "elm,loop_x,set", "elm");
+   else
+     edje_object_signal_emit(sid->edje_obj, "elm,loop_x,unset", "elm");
+
+   if(sid->loop_v)
+     edje_object_signal_emit(sid->edje_obj, "elm,loop_y,set", "elm");
+   else
+     edje_object_signal_emit(sid->edje_obj, "elm,loop_y,unset", "elm");
 }
 
 EOLIAN static void

-- 


Reply via email to