[epiphany] window: Move stop/reload state from header bar to window



commit f9732f9802620bd2135cab361f28299e717b8395
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Jun 7 20:58:30 2018 +0200

    window: Move stop/reload state from header bar to window
    
    Add change_combined_stop_reload_state() to EphyWindow to update the
    state of the stop/reload button.
    
    This will be needed when adding an action bar to the window as both the
    header bar and the action bar will have to update their stop/reload
    buttons simultaneously.
    
    Also remove ephy_header_bar_change_combined_stop_reload_state(), now
    unused.

 src/ephy-header-bar.c | 16 ----------------
 src/ephy-header-bar.h |  5 -----
 src/ephy-window.c     | 16 +++++++++++++++-
 3 files changed, 15 insertions(+), 22 deletions(-)
---
diff --git a/src/ephy-header-bar.c b/src/ephy-header-bar.c
index 417b9f9bc..22570f463 100644
--- a/src/ephy-header-bar.c
+++ b/src/ephy-header-bar.c
@@ -180,22 +180,6 @@ sync_chromes_visibility (EphyHeaderBar *header_bar)
   gtk_widget_set_visible (header_bar->new_tab_button, chrome & EPHY_WINDOW_CHROME_TABSBAR);
 }
 
-void
-ephy_header_bar_change_combined_stop_reload_state (GSimpleAction *action,
-                                                   GVariant      *loading,
-                                                   gpointer       user_data)
-{
-  EphyWindow *window = EPHY_WINDOW (user_data);
-  EphyHeaderBar *header_bar;
-
-  header_bar = EPHY_HEADER_BAR (ephy_window_get_header_bar (window));
-
-  ephy_action_bar_start_change_combined_stop_reload_state (header_bar->action_bar_start,
-                                                           g_variant_get_boolean (loading));
-
-  g_simple_action_set_state (action, loading);
-}
-
 static void
 add_bookmark_button_clicked_cb (EphyLocationEntry *entry,
                                 gpointer          *user_data)
diff --git a/src/ephy-header-bar.h b/src/ephy-header-bar.h
index bdf420e5d..e186207cd 100644
--- a/src/ephy-header-bar.h
+++ b/src/ephy-header-bar.h
@@ -33,11 +33,6 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE (EphyHeaderBar, ephy_header_bar, EPHY, HEADER_BAR, GtkHeaderBar)
 
 GtkWidget       *ephy_header_bar_new                               (EphyWindow    *window);
-
-void             ephy_header_bar_change_combined_stop_reload_state (GSimpleAction *action,
-                                                                    GVariant      *state,
-                                                                    gpointer       user_data);
-
 EphyTitleWidget *ephy_header_bar_get_title_widget                  (EphyHeaderBar *header_bar);
 GtkWidget       *ephy_header_bar_get_zoom_level_button             (EphyHeaderBar *header_bar);
 GtkWidget       *ephy_header_bar_get_page_menu_button              (EphyHeaderBar *header_bar);
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 1522126eb..1c2b40bab 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -705,6 +705,20 @@ enable_edit_actions_sensitivity (EphyWindow *window)
   g_simple_action_set_enabled (G_SIMPLE_ACTION (action), TRUE);
 }
 
+static void
+change_combined_stop_reload_state (GSimpleAction *action,
+                                   GVariant      *loading,
+                                   gpointer       user_data)
+{
+  EphyWindow *window = EPHY_WINDOW (user_data);
+  EphyActionBarStart *header_bar_start = ephy_header_bar_get_action_bar_start (EPHY_HEADER_BAR 
(window->header_bar));
+
+  ephy_action_bar_start_change_combined_stop_reload_state (header_bar_start,
+                                                           g_variant_get_boolean (loading));
+
+  g_simple_action_set_state (action, loading);
+}
+
 static const GActionEntry window_entries [] =
 {
   { "page-menu", window_cmd_page_menu },
@@ -764,7 +778,7 @@ static const GActionEntry toolbar_entries [] = {
   { "stop", window_cmd_stop },
   { "reload", window_cmd_reload },
   { "always-stop", window_cmd_stop },
-  { "combined-stop-reload", window_cmd_combined_stop_reload, NULL, "false", 
ephy_header_bar_change_combined_stop_reload_state }
+  { "combined-stop-reload", window_cmd_combined_stop_reload, NULL, "false", 
change_combined_stop_reload_state }
 };
 
 static const GActionEntry popup_entries [] = {


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