[epiphany] Revert "window: Allow back swipe for the pages view"



commit 390e01aaade3d893167aa3b11c275f113f24bd7b
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Tue May 26 11:05:42 2020 -0500

    Revert "window: Allow back swipe for the pages view"
    
    This reverts commit 47ead8aee185cbdc49114ab6956f391556d7ad05.

 src/ephy-window.c | 60 +++++++++++++++++++++++++++----------------------------
 1 file changed, 30 insertions(+), 30 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index e41b34188..7ecdaaa5b 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -146,7 +146,7 @@ struct _EphyWindow {
   DzlApplicationWindow parent_instance;
 
   GtkWidget *header_bar;
-  GtkWidget *main_deck;
+  GtkWidget *main_stack;
   EphyPagesView *pages_view;
   EphyBookmarksManager *bookmarks_manager;
   GHashTable *action_labels;
@@ -3454,33 +3454,33 @@ title_widget_lock_clicked_cb (EphyTitleWidget *title_widget,
 static GtkWidget *
 setup_header_bar (EphyWindow *window)
 {
-  GtkWidget *title_bar;
   GtkWidget *header_bar;
   GtkWidget *tab_header_bar;
-  GtkWidget *header_deck;
+  GtkWidget *header_stack;
   EphyTitleWidget *title_widget;
-  HdySwipeGroup *swipe_group;
 
-  title_bar = hdy_title_bar_new ();
   header_bar = ephy_header_bar_new (window);
   tab_header_bar = ephy_tab_header_bar_new ();
-  header_deck = hdy_deck_new ();
-  hdy_deck_set_can_swipe_back (HDY_DECK (header_deck), TRUE);
-
-  gtk_container_add (GTK_CONTAINER (title_bar), header_deck);
-  gtk_container_add (GTK_CONTAINER (header_deck), header_bar);
-  gtk_container_add (GTK_CONTAINER (header_deck), tab_header_bar);
-
-  hdy_deck_set_visible_child (HDY_DECK (header_deck), header_bar);
-
-  swipe_group = hdy_swipe_group_new ();
-  hdy_swipe_group_add_swipeable (swipe_group, HDY_SWIPEABLE (header_deck));
-  hdy_swipe_group_add_swipeable (swipe_group, HDY_SWIPEABLE (window->main_deck));
-
-  dzl_application_window_set_titlebar (DZL_APPLICATION_WINDOW (window), title_bar);
-  gtk_widget_show (title_bar);
+  header_stack = gtk_stack_new ();
+
+  gtk_stack_add_named (GTK_STACK (header_stack), header_bar, "content");
+  gtk_stack_add_named (GTK_STACK (header_stack), tab_header_bar, "tabs");
+
+  g_object_bind_property (G_OBJECT (window->main_stack),
+                          "visible-child-name", G_OBJECT (header_stack),
+                          "visible-child-name", G_BINDING_SYNC_CREATE);
+  g_object_bind_property (G_OBJECT (window->main_stack),
+                          "transition-type", G_OBJECT (header_stack),
+                          "transition-type", G_BINDING_SYNC_CREATE);
+  g_object_bind_property (G_OBJECT (window->main_stack),
+                          "transition-duration", G_OBJECT (header_stack),
+                          "transition-duration", G_BINDING_SYNC_CREATE);
+
+  dzl_application_window_set_titlebar (DZL_APPLICATION_WINDOW (window), header_stack);
   gtk_widget_show (header_bar);
-  gtk_widget_show (header_deck);
+  gtk_widget_show (header_stack);
+
+  gtk_stack_set_visible_child_name (GTK_STACK (header_stack), "content");
 
   title_widget = ephy_header_bar_get_title_widget (EPHY_HEADER_BAR (header_bar));
   g_signal_connect (title_widget, "lock-clicked",
@@ -3754,7 +3754,7 @@ ephy_window_constructed (GObject *object)
   setup_tab_accels (window);
 
   window->notebook = setup_notebook (window);
-  window->main_deck = hdy_deck_new ();
+  window->main_stack = gtk_stack_new ();
   window->pages_view = ephy_pages_view_new ();
 
   ephy_pages_view_set_notebook (window->pages_view, EPHY_NOTEBOOK (window->notebook));
@@ -3781,16 +3781,16 @@ ephy_window_constructed (GObject *object)
 
   gtk_box_pack_start (box, GTK_WIDGET (window->notebook), TRUE, TRUE, 0);
   gtk_box_pack_start (box, GTK_WIDGET (window->action_bar), FALSE, TRUE, 0);
-  gtk_container_add (GTK_CONTAINER (window->main_deck), GTK_WIDGET (box));
-  gtk_container_add (GTK_CONTAINER (window->main_deck), GTK_WIDGET (window->pages_view));
-  gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (window->main_deck));
+  gtk_stack_add_named (GTK_STACK (window->main_stack), GTK_WIDGET (box), "content");
+  gtk_stack_add_named (GTK_STACK (window->main_stack), GTK_WIDGET (window->pages_view), "tabs");
+  gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (window->main_stack));
   gtk_widget_show_all (GTK_WIDGET (window->pages_view));
-  gtk_widget_show (GTK_WIDGET (window->main_deck));
+  gtk_widget_show (GTK_WIDGET (window->main_stack));
   gtk_widget_show (GTK_WIDGET (box));
   gtk_widget_show (GTK_WIDGET (window->notebook));
 
-  hdy_deck_set_visible_child (HDY_DECK (window->main_deck), GTK_WIDGET (box));
-  hdy_deck_set_can_swipe_back (HDY_DECK (window->main_deck), TRUE);
+  gtk_stack_set_visible_child_name (GTK_STACK (window->main_stack), "content");
+  gtk_stack_set_transition_type (GTK_STACK (window->main_stack), GTK_STACK_TRANSITION_TYPE_CROSSFADE);
 
   /* other notifiers */
   action_group = gtk_widget_get_action_group (GTK_WIDGET (window), "win");
@@ -3963,7 +3963,7 @@ ephy_window_open_pages_view (EphyWindow *window)
 {
   g_assert (EPHY_IS_WINDOW (window));
 
-  hdy_deck_navigate (HDY_DECK (window->main_deck), HDY_NAVIGATION_DIRECTION_FORWARD);
+  gtk_stack_set_visible_child_name (GTK_STACK (window->main_stack), "tabs");
 }
 
 /**
@@ -3977,7 +3977,7 @@ ephy_window_close_pages_view (EphyWindow *window)
 {
   g_assert (EPHY_IS_WINDOW (window));
 
-  hdy_deck_navigate (HDY_DECK (window->main_deck), HDY_NAVIGATION_DIRECTION_BACK);
+  gtk_stack_set_visible_child_name (GTK_STACK (window->main_stack), "content");
 }
 
 /**


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