hermet pushed a commit to branch master.

commit 70d3ccbe3061a81b9523eae7b84fc432ce6489e3
Author: ChunEon Park <[email protected]>
Date:   Fri Jul 26 21:12:27 2013 +0900

    elementary/flip - fix the flip page to not flip on a direction if the 
direction is disabled.
---
 ChangeLog          |  5 +++++
 NEWS               |  1 +
 src/lib/elm_flip.c | 24 ++++++++++++++++++------
 3 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index beb68e3..954dd50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1515,3 +1515,8 @@
 
         * File Selector : Support elm_object_part_text_set() for the ok, cancel
         part to change the OK, Cancel button label.
+
+2013-07-26  ChunEon Park (Hermet)
+
+        * Flip : Fix the flip page to not flip on a direction if the direction
+        is disabled.
diff --git a/NEWS b/NEWS
index 178391b..54354b9 100644
--- a/NEWS
+++ b/NEWS
@@ -265,6 +265,7 @@ Fixes:
    * Entry: Change the keyboard mode only if the imf is not available. If the
    imf is available, the keyboard mode should be decided by ime, but not entry.
    This prevents the asynchronous states between ime and conformant.
+   * Flip : Fix the flip page to not flip on a direction if the direction is 
disabled.
 
 Removals:
 
diff --git a/src/lib/elm_flip.c b/src/lib/elm_flip.c
index 6a11233..5e12d4a 100644
--- a/src/lib/elm_flip.c
+++ b/src/lib/elm_flip.c
@@ -1578,8 +1578,8 @@ _up_cb(void *data,
 
    if (ev->button != 1) return;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
-
    sd->down = 0;
+   if (!sd->started) return;
    evas_object_geometry_get(data, &x, &y, &w, &h);
    sd->x = ev->canvas.x - x;
    sd->y = ev->canvas.y - y;
@@ -1633,7 +1633,6 @@ _move_cb(void *data,
    Evas_Coord x, y, w, h;
 
    ELM_FLIP_DATA_GET(fl, sd);
-
    if (!sd->down) return;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
    evas_object_geometry_get(data, &x, &y, &w, &h);
@@ -1653,14 +1652,27 @@ _move_cb(void *data,
              sd->dir = ELM_FLIP_DIRECTION_LEFT;
              if ((sd->x > (w / 2)) &&
                  (dx < 0) && (abs(dx) > abs(dy)))
-               sd->dir = ELM_FLIP_DIRECTION_LEFT;
+               {
+                  sd->dir = ELM_FLIP_DIRECTION_LEFT;
+                  if (!sd->dir_enabled[ELM_FLIP_DIRECTION_LEFT]) return;
+               }
              else if ((sd->x < (w / 2)) && (dx >= 0) &&
                       (abs(dx) > abs(dy)))
-               sd->dir = ELM_FLIP_DIRECTION_RIGHT;
+               {
+                  sd->dir = ELM_FLIP_DIRECTION_RIGHT;
+                  if (!sd->dir_enabled[ELM_FLIP_DIRECTION_RIGHT]) return;
+               }
              else if ((sd->y > (h / 2)) && (dy < 0) && (abs(dy) >= abs(dx)))
-               sd->dir = ELM_FLIP_DIRECTION_UP;
+               {
+                  sd->dir = ELM_FLIP_DIRECTION_UP;
+                  if (!sd->dir_enabled[ELM_FLIP_DIRECTION_UP]) return;
+               }
              else if ((sd->y < (h / 2)) && (dy >= 0) && (abs(dy) >= abs(dx)))
-               sd->dir = ELM_FLIP_DIRECTION_DOWN;  // down
+               {
+                  sd->dir = ELM_FLIP_DIRECTION_DOWN;
+                  if (!sd->dir_enabled[ELM_FLIP_DIRECTION_DOWN]) return;
+               }
+
              sd->started = EINA_TRUE;
              if (sd->intmode == ELM_FLIP_INTERACTION_PAGE)
                sd->pageflip = EINA_TRUE;

-- 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

Reply via email to