Commit 2bb5f221 authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko
Browse files

leaflet: Allow hdy_leaflet_navigate() regardless of swipe properties

Fixes Librem5/libhandy#200

Signed-off-by: Alexander Mikhaylenko's avatarAlexander Mikhaylenko <alexm@gnome.org>
parent 2f2a590d
......@@ -1391,22 +1391,6 @@ find_swipeable_child (HdyLeaflet *self,
return child;
}
static gboolean
can_swipe_in_direction (HdyLeaflet *self,
HdyNavigationDirection direction)
{
HdyLeafletPrivate *priv = hdy_leaflet_get_instance_private (self);
switch (direction) {
case HDY_NAVIGATION_DIRECTION_BACK:
return priv->child_transition.can_swipe_back;
case HDY_NAVIGATION_DIRECTION_FORWARD:
return priv->child_transition.can_swipe_forward;
default:
g_assert_not_reached ();
}
}
/**
* hdy_leaflet_navigate
* @self: a #HdyLeaflet
......@@ -1416,9 +1400,6 @@ can_swipe_in_direction (HdyLeaflet *self,
* child property set to %FALSE, similar to performing a swipe gesture to go
* in @direction.
*
* Does nothing if #HdyLeaflet:can-swipe-back or #HdyLeaflet:can-swipe-forward
* is %FALSE.
*
* Returns: %TRUE if visible child was changed, %FALSE otherwise.
*
* Since: 1.0
......@@ -1434,9 +1415,6 @@ hdy_leaflet_navigate (HdyLeaflet *self,
priv = hdy_leaflet_get_instance_private (self);
if (!can_swipe_in_direction (self, direction))
return FALSE;
child = find_swipeable_child (self, direction);
if (!child)
......@@ -3314,6 +3292,22 @@ get_current_progress (HdyLeaflet *self)
return priv->child_transition.progress * (new_first ? 1 : -1);
}
static gboolean
can_swipe_in_direction (HdyLeaflet *self,
HdyNavigationDirection direction)
{
HdyLeafletPrivate *priv = hdy_leaflet_get_instance_private (self);
switch (direction) {
case HDY_NAVIGATION_DIRECTION_BACK:
return priv->child_transition.can_swipe_back;
case HDY_NAVIGATION_DIRECTION_FORWARD:
return priv->child_transition.can_swipe_forward;
default:
g_assert_not_reached ();
}
}
static void
hdy_leaflet_begin_swipe (HdySwipeable *swipeable,
HdyNavigationDirection direction,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment