[epiphany] ephy-window: Move the reload button to the header bar
- From: Yosef Or Boczko <yoseforb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-window: Move the reload button to the header bar
- Date: Sat, 9 Aug 2014 18:28:24 +0000 (UTC)
commit 5f23adee1e370e70e1a1983570fca669d9357f6c
Author: Yosef Or Boczko <yoseforb src gnome org>
Date: Tue May 20 12:39:16 2014 +0300
ephy-window: Move the reload button to the header bar
https://bugzilla.gnome.org/show_bug.cgi?id=729812
src/ephy-title-box.c | 32 ++------------------------------
src/ephy-toolbar.c | 30 ++++++++++++------------------
2 files changed, 14 insertions(+), 48 deletions(-)
---
diff --git a/src/ephy-title-box.c b/src/ephy-title-box.c
index 9ffada7..2cb592c 100644
--- a/src/ephy-title-box.c
+++ b/src/ephy-title-box.c
@@ -146,39 +146,11 @@ 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..9e5492a 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);
@@ -144,6 +141,18 @@ ephy_toolbar_constructed (GObject *object)
gtk_style_context_add_class (gtk_widget_get_style_context (button), "image-button");
gtk_container_add (GTK_CONTAINER (box), button);
+ /* 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_container_add (GTK_CONTAINER (box), button);
+ gtk_widget_show (button);
+
gtk_style_context_add_class (gtk_widget_get_style_context (box),
"raised");
gtk_style_context_add_class (gtk_widget_get_style_context (box),
@@ -183,21 +192,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]