[libhandy/wip/haecker-felix/flap-widget] Swipe anywhere for unfolded+over



commit a504c9bbe25eedf9fd5c9e6b9397c566f3a308de
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Nov 23 12:26:15 2020 +0500

    Swipe anywhere for unfolded+over

 src/hdy-flap.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/hdy-flap.c b/src/hdy-flap.c
index b89a7b83..3bd715f8 100644
--- a/src/hdy-flap.c
+++ b/src/hdy-flap.c
@@ -1500,6 +1500,8 @@ hdy_flap_get_swipe_area (HdySwipeable           *swipeable,
   HdyFlap *self = HDY_FLAP (swipeable);
   GtkAllocation *alloc;
   gint width, height;
+  gdouble flap_factor, content_factor;
+  gboolean content_above_flap;
 
   if (!self->flap) {
     rect->x = 0;
@@ -1513,9 +1515,13 @@ hdy_flap_get_swipe_area (HdySwipeable           *swipeable,
   width = gtk_widget_get_allocated_width (GTK_WIDGET (self));
   height = gtk_widget_get_allocated_height (GTK_WIDGET (self));
 
+  content_above_flap = transition_is_content_above_flap (self);
+  flap_factor = transition_get_flap_motion_factor (self);
+  content_factor = transition_get_content_motion_factor (self);
+
   if (!is_drag ||
-      (transition_get_flap_motion_factor (self) >=1 &&
-       transition_get_content_motion_factor (self) >= 1)) {
+      (flap_factor >= 1 && content_factor >= 1) ||
+      (self->fold_progress < 1 && flap_factor > 0)) {
     rect->x = 0;
     rect->y = 0;
     rect->width = width;
@@ -1524,7 +1530,7 @@ hdy_flap_get_swipe_area (HdySwipeable           *swipeable,
     return;
   }
 
-  alloc = transition_is_content_above_flap (self)
+  alloc = content_above_flap
     ? &self->content_allocation
     : &self->flap_allocation;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]