[libhandy/swipe-tracker-public: 2/16] example: Remove workarounds for nested swipeable widgets
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy/swipe-tracker-public: 2/16] example: Remove workarounds for nested swipeable widgets
- Date: Sun, 14 Jun 2020 20:44:44 +0000 (UTC)
commit cc2df9b6f892b74491a28ec003e230defec7af10
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sun Jun 14 21:25:26 2020 +0500
example: Remove workarounds for nested swipeable widgets
They aren't necessary anymore.
Signed-off-by: Alexander Mikhaylenko <alexm gnome org>
examples/hdy-demo-window.c | 29 ++---------------------------
examples/hdy-demo-window.ui | 1 -
2 files changed, 2 insertions(+), 28 deletions(-)
---
diff --git a/examples/hdy-demo-window.c b/examples/hdy-demo-window.c
index 2dcb7838..01351812 100644
--- a/examples/hdy-demo-window.c
+++ b/examples/hdy-demo-window.c
@@ -80,32 +80,17 @@ hdy_demo_window_key_pressed_cb (GtkWidget *sender,
return FALSE;
}
-static void
-update_leaflet_swipe (HdyDemoWindow *self)
-{
- gboolean first_page = (hdy_carousel_get_position (self->carousel) <= 0);
- gboolean carousel_visible =
- (gtk_stack_get_visible_child (self->stack) == GTK_WIDGET (self->carousel));
-
- hdy_leaflet_set_can_swipe_back (self->content_box,
- !carousel_visible || first_page);
-}
-
static void
update (HdyDemoWindow *self)
{
const gchar *header_bar_name = "default";
- gboolean leaflet_can_swipe_back = TRUE;
- if (g_strcmp0 (gtk_stack_get_visible_child_name (self->stack), "deck") == 0) {
+ if (g_strcmp0 (gtk_stack_get_visible_child_name (self->stack), "deck") == 0)
header_bar_name = "deck";
- leaflet_can_swipe_back = g_strcmp0 (hdy_deck_get_visible_child_name (self->content_deck), "sub") != 0;
- } else if (g_strcmp0 (gtk_stack_get_visible_child_name (self->stack), "search-bar") == 0) {
+ else if (g_strcmp0 (gtk_stack_get_visible_child_name (self->stack), "search-bar") == 0)
header_bar_name = "search-bar";
- }
gtk_stack_set_visible_child_name (self->header_stack, header_bar_name);
- hdy_leaflet_set_can_swipe_back (self->content_box, leaflet_can_swipe_back);
}
static void
@@ -122,7 +107,6 @@ hdy_demo_window_notify_visible_child_cb (GObject *sender,
update (self);
hdy_leaflet_navigate (self->content_box, HDY_NAVIGATION_DIRECTION_FORWARD);
- update_leaflet_swipe (self);
}
static void
@@ -239,14 +223,6 @@ carousel_orientation_name (HdyEnumValueObject *value,
}
}
-static void
-notify_carousel_position_cb (GObject *sender,
- GParamSpec *pspec,
- HdyDemoWindow *self)
-{
- update_leaflet_swipe (self);
-}
-
static void
notify_carousel_orientation_cb (GObject *sender,
GParamSpec *pspec,
@@ -419,7 +395,6 @@ hdy_demo_window_class_init (HdyDemoWindowClass *klass)
gtk_widget_class_bind_template_callback_full (widget_class, "deck_go_next_row_activated_cb",
G_CALLBACK(deck_go_next_row_activated_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "theme_variant_button_clicked_cb",
G_CALLBACK(theme_variant_button_clicked_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "view_switcher_demo_clicked_cb",
G_CALLBACK(view_switcher_demo_clicked_cb));
- gtk_widget_class_bind_template_callback_full (widget_class, "notify_carousel_position_cb",
G_CALLBACK(notify_carousel_position_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "notify_carousel_orientation_cb",
G_CALLBACK(notify_carousel_orientation_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "notify_carousel_indicator_style_cb",
G_CALLBACK(notify_carousel_indicator_style_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "carousel_return_clicked_cb",
G_CALLBACK(carousel_return_clicked_cb));
diff --git a/examples/hdy-demo-window.ui b/examples/hdy-demo-window.ui
index 21a7844b..41b5293a 100644
--- a/examples/hdy-demo-window.ui
+++ b/examples/hdy-demo-window.ui
@@ -1667,7 +1667,6 @@
<property name="visible">True</property>
<property name="center_content">True</property>
<property name="indicator_spacing">6</property>
- <signal name="notify::position" handler="notify_carousel_position_cb"/>
<child>
<object class="GtkBox">
<property name="visible">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]