[epiphany] Revert "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] Revert "ephy-window: Move the reload button to the header bar"
- Date: Sat, 9 Aug 2014 18:30:22 +0000 (UTC)
commit 6896040b1833a6fd036eda19c6edea3dc6f99c6e
Author: Yosef Or Boczko <yoseforb src gnome org>
Date: Sat Aug 9 21:29:16 2014 +0300
Revert "ephy-window: Move the reload button to the header bar"
This reverts commit 5f23adee1e370e70e1a1983570fca669d9357f6c.
src/ephy-title-box.c | 32 ++++++++++++++++++++++++++++++--
src/ephy-toolbar.c | 30 ++++++++++++++++++------------
2 files changed, 48 insertions(+), 14 deletions(-)
---
diff --git a/src/ephy-title-box.c b/src/ephy-title-box.c
index 2cb592c..9ffada7 100644
--- a/src/ephy-title-box.c
+++ b/src/ephy-title-box.c
@@ -146,11 +146,39 @@ 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_stack_add_named (GTK_STACK (title_box), priv->entry, "address-bar");
-
+ 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);
}
static void
diff --git a/src/ephy-toolbar.c b/src/ephy-toolbar.c
index 9e5492a..7b2646e 100644
--- a/src/ephy-toolbar.c
+++ b/src/ephy-toolbar.c
@@ -102,11 +102,14 @@ 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);
@@ -141,18 +144,6 @@ 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),
@@ -192,6 +183,21 @@ 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]