[epiphany] Revert "window: Stop exposing GtkStack"
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Revert "window: Stop exposing GtkStack"
- Date: Wed, 3 Jun 2020 15:23:54 +0000 (UTC)
commit 9ae10f33da9a5064e6ef9920a41ff69abd6c5cb3
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Wed Jun 3 10:23:15 2020 -0500
Revert "window: Stop exposing GtkStack"
This reverts commit 478d9a9c22935f7f924977255c149e225a91204e.
src/ephy-pages-view.c | 4 +++-
src/ephy-window.c | 27 +++++++--------------------
src/ephy-window.h | 4 +---
src/window-commands.c | 16 +++++++++++++---
4 files changed, 24 insertions(+), 27 deletions(-)
---
diff --git a/src/ephy-pages-view.c b/src/ephy-pages-view.c
index f74159685..a565f3b7c 100644
--- a/src/ephy-pages-view.c
+++ b/src/ephy-pages-view.c
@@ -71,6 +71,7 @@ row_activated_cb (EphyPagesView *self,
{
gint new_page;
EphyWindow *window;
+ GtkWidget *stack;
GApplication *application;
g_assert (EPHY_IS_PAGES_VIEW (self));
@@ -78,6 +79,7 @@ row_activated_cb (EphyPagesView *self,
application = g_application_get_default ();
window = EPHY_WINDOW (gtk_application_get_active_window (GTK_APPLICATION (application)));
+ stack = ephy_window_get_stack (window);
if (!row)
return;
@@ -85,7 +87,7 @@ row_activated_cb (EphyPagesView *self,
new_page = gtk_list_box_row_get_index (row);
gtk_notebook_set_current_page (GTK_NOTEBOOK (self->notebook), new_page);
- ephy_window_close_pages_view (window);
+ gtk_stack_set_visible_child_name (GTK_STACK (stack), "content");
}
static void
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 7ecdaaa5b..e046a0290 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -547,7 +547,7 @@ update_adaptive_mode (EphyWindow *window)
* to the main view.
*/
if (adaptive_mode == EPHY_ADAPTIVE_MODE_NORMAL)
- ephy_window_close_pages_view (window);
+ gtk_stack_set_visible_child_name (GTK_STACK (window->main_stack), "content");
}
static void
@@ -3953,33 +3953,20 @@ ephy_window_get_notebook (EphyWindow *window)
}
/**
- * ephy_window_open_pages_view
+ * ephy_window_get_stack:
* @window: an #EphyWindow
*
- * Opens the mobile pages view
- **/
-void
-ephy_window_open_pages_view (EphyWindow *window)
-{
- g_assert (EPHY_IS_WINDOW (window));
-
- gtk_stack_set_visible_child_name (GTK_STACK (window->main_stack), "tabs");
-}
-
-/**
- * ephy_window_close_pages_view
- * @window: an #EphyWindow
+ * Returns the #GtkStack housing the content and tab views
*
- * Closes the mobile pages view
+ * Return value: (transfer none): the @window's #GtkStack
**/
-void
-ephy_window_close_pages_view (EphyWindow *window)
+GtkWidget *
+ephy_window_get_stack (EphyWindow *window)
{
g_assert (EPHY_IS_WINDOW (window));
- gtk_stack_set_visible_child_name (GTK_STACK (window->main_stack), "content");
+ return GTK_WIDGET (window->main_stack);
}
-
/**
* ephy_window_get_find_toolbar:
* @window: an #EphyWindow
diff --git a/src/ephy-window.h b/src/ephy-window.h
index 01c272846..81d68df9a 100644
--- a/src/ephy-window.h
+++ b/src/ephy-window.h
@@ -47,9 +47,7 @@ typedef enum
EphyWindow *ephy_window_new (void);
GtkWidget *ephy_window_get_notebook (EphyWindow *window);
-
-void ephy_window_open_pages_view (EphyWindow *window);
-void ephy_window_close_pages_view (EphyWindow *window);
+GtkWidget *ephy_window_get_stack (EphyWindow *window);
void ephy_window_load_url (EphyWindow *window,
const char *url);
diff --git a/src/window-commands.c b/src/window-commands.c
index d706c969d..e561f4371 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -1240,9 +1240,11 @@ window_cmd_new_tab (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
+ GtkWidget *stack;
EphyWindow *window = user_data;
char *url;
+ stack = ephy_window_get_stack (window);
url = g_settings_get_string (EPHY_SETTINGS_MAIN, EPHY_PREFS_HOMEPAGE_URL);
if (g_strcmp0 (url, "about:blank") != 0) {
g_free (url);
@@ -1252,7 +1254,7 @@ window_cmd_new_tab (GSimpleAction *action,
ephy_link_open (EPHY_LINK (window),
url, NULL,
EPHY_LINK_NEW_TAB | EPHY_LINK_JUMP_TO);
- ephy_window_close_pages_view (window);
+ gtk_stack_set_visible_child_name (GTK_STACK (stack), "content");
g_free (url);
}
@@ -2499,7 +2501,11 @@ window_cmd_go_content (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- ephy_window_close_pages_view (EPHY_WINDOW (user_data));
+ GtkWidget *stack;
+ EphyWindow *window = EPHY_WINDOW (user_data);
+
+ stack = ephy_window_get_stack (window);
+ gtk_stack_set_visible_child_name (GTK_STACK (stack), "content");
}
void
@@ -2507,7 +2513,11 @@ window_cmd_go_tabs_view (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- ephy_window_open_pages_view (EPHY_WINDOW (user_data));
+ GtkWidget *stack;
+ EphyWindow *window = EPHY_WINDOW (user_data);
+
+ stack = ephy_window_get_stack (window);
+ gtk_stack_set_visible_child_name (GTK_STACK (stack), "tabs");
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]