[epiphany] ephy-window: Move the reload button to the header bar



commit a9cac88f27e833bf5d959b49fd2d52b1e0c8131e
Author: Yosef Or Boczko <yoseforb src gnome org>
Date:   Sun Aug 10 10:36:41 2014 +0300

    ephy-window: Move the reload button to the header bar
    
    From the location entry.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729812

 src/ephy-title-box.c |   31 +------------------------------
 src/ephy-toolbar.c   |   29 +++++++++++------------------
 2 files changed, 12 insertions(+), 48 deletions(-)
---
diff --git a/src/ephy-title-box.c b/src/ephy-title-box.c
index e682f3a..1b414ac 100644
--- a/src/ephy-title-box.c
+++ b/src/ephy-title-box.c
@@ -148,39 +148,10 @@ static void
 ephy_title_box_add_address_bar (EphyTitleBox *title_box)
 {
   EphyTitleBoxPrivate *priv = ephy_title_box_get_instance_private (title_box);
-  GtkActionGroup      *action_group;
-  GtkAction           *action;
-  GtkWidget           *box;
-  GtkWidget           *reload;
-  GtkSizeGroup        *size;
-
-  box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-  gtk_widget_show (box);
-  gtk_style_context_add_class (gtk_widget_get_style_context (box), "location-entry");
-  gtk_style_context_add_class (gtk_widget_get_style_context (box), GTK_STYLE_CLASS_LINKED);
-  gtk_stack_add_named (GTK_STACK (title_box), box, "address-bar");
 
   priv->entry = ephy_location_entry_new ();
   gtk_widget_show (priv->entry);
-  gtk_box_pack_start (GTK_BOX (box), priv->entry, TRUE, TRUE, 0);
-
-  /* Reload/Stop */
-  reload = gtk_button_new ();
-  gtk_button_set_focus_on_click (GTK_BUTTON (reload), FALSE);
-  gtk_widget_show (reload);
-  /* FIXME: apparently we need an image inside the button for the action
-  * icon to appear. */
-  gtk_button_set_image (GTK_BUTTON (reload), gtk_image_new ());
-  gtk_widget_set_valign (reload, GTK_ALIGN_CENTER);
-  action_group = ephy_window_get_toolbar_action_group (priv->window);
-  action = gtk_action_group_get_action (action_group, "ViewCombinedStopReload");
-  gtk_activatable_set_related_action (GTK_ACTIVATABLE (reload), action);
-  gtk_container_add (GTK_CONTAINER (box), reload);
-
-  size = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
-  gtk_size_group_add_widget (size, priv->entry);
-  gtk_size_group_add_widget (size, reload);
-  g_object_unref (size);
+  gtk_stack_add_named (GTK_STACK (title_box), priv->entry, "address-bar");
 }
 
 static void
diff --git a/src/ephy-toolbar.c b/src/ephy-toolbar.c
index 7b2646e..f9a86e9 100644
--- a/src/ephy-toolbar.c
+++ b/src/ephy-toolbar.c
@@ -102,14 +102,11 @@ ephy_toolbar_constructed (GObject *object)
   GtkActionGroup *action_group;
   GtkAction *action;
   GtkWidget *toolbar, *box, *button;
-  EphyEmbedShellMode mode;
 
   G_OBJECT_CLASS (ephy_toolbar_parent_class)->constructed (object);
 
   toolbar = GTK_WIDGET (object);
 
-  mode = ephy_embed_shell_get_mode (ephy_embed_shell_get_default ());
-
   g_signal_connect_swapped (priv->window, "notify::chrome",
                             G_CALLBACK (sync_chromes_visibility), toolbar);
 
@@ -151,6 +148,17 @@ ephy_toolbar_constructed (GObject *object)
 
   gtk_header_bar_pack_start (GTK_HEADER_BAR (toolbar), box);
 
+  /* Reload/Stop */
+  button = gtk_button_new ();
+  /* FIXME: apparently we need an image inside the button for the action
+   * icon to appear. */
+  gtk_button_set_image (GTK_BUTTON (button), gtk_image_new ());
+  gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
+  action = gtk_action_group_get_action (action_group, "ViewCombinedStopReload");
+  gtk_activatable_set_related_action (GTK_ACTIVATABLE (button),
+                                      action);
+  gtk_header_bar_pack_start (GTK_HEADER_BAR (toolbar), button);
+
   /* New Tab */
   button = gtk_button_new ();
   priv->new_tab_button = button;
@@ -183,21 +191,6 @@ ephy_toolbar_constructed (GObject *object)
   gtk_activatable_set_related_action (GTK_ACTIVATABLE (button),
                                       action);
   gtk_header_bar_pack_end (GTK_HEADER_BAR (toolbar), button);
-
-  /* Reload/Stop for web application. */
-  if (mode == EPHY_EMBED_SHELL_MODE_APPLICATION)
-  {
-    button = gtk_button_new ();
-    /* FIXME: apparently we need an image inside the button for the action
-     * icon to appear. */
-    gtk_button_set_image (GTK_BUTTON (button), gtk_image_new ());
-    gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
-    action = gtk_action_group_get_action (action_group, "ViewCombinedStopReload");
-    gtk_activatable_set_related_action (GTK_ACTIVATABLE (button),
-                                        action);
-    gtk_header_bar_pack_end (GTK_HEADER_BAR (toolbar), button);
-    gtk_widget_show (button);
-  }
 }
 
 static void


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