[epiphany] Rename EphyToolbar to EphyHeaderBar
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Rename EphyToolbar to EphyHeaderBar
- Date: Sun, 11 Sep 2016 04:25:48 +0000 (UTC)
commit 988f6d0b22356e6d05f3d045c36611a58e03689d
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sat Sep 10 19:49:08 2016 -0500
Rename EphyToolbar to EphyHeaderBar
Long overdue
src/Makefile.am | 4 +-
src/bookmarks/ephy-bookmarks-ui.c | 8 +-
src/{ephy-toolbar.c => ephy-header-bar.c} | 242 ++++++++++++++--------------
src/{ephy-toolbar.h => ephy-header-bar.h} | 20 ++--
src/ephy-window.c | 74 +++++-----
src/ephy-window.h | 6 +-
6 files changed, 177 insertions(+), 177 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 17aec0e..7b88a18 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,6 +29,8 @@ libephymain_la_SOURCES = \
ephy-encoding-dialog.h \
ephy-encoding-row.c \
ephy-encoding-row.h \
+ ephy-header-bar.c \
+ ephy-header-bar.h \
ephy-history-window.c \
ephy-history-window.h \
ephy-link.c \
@@ -47,8 +49,6 @@ libephymain_la_SOURCES = \
ephy-shell.h \
ephy-title-box.c \
ephy-title-box.h \
- ephy-toolbar.c \
- ephy-toolbar.h \
ephy-window.c \
ephy-window.h \
languages.h \
diff --git a/src/bookmarks/ephy-bookmarks-ui.c b/src/bookmarks/ephy-bookmarks-ui.c
index ea88365..49466f1 100644
--- a/src/bookmarks/ephy-bookmarks-ui.c
+++ b/src/bookmarks/ephy-bookmarks-ui.c
@@ -30,6 +30,7 @@
#include "ephy-embed-shell.h"
#include "ephy-file-helpers.h"
#include "ephy-gui.h"
+#include "ephy-header-bar.h"
#include "ephy-link.h"
#include "ephy-node-common.h"
#include "ephy-open-tabs-action.h"
@@ -37,7 +38,6 @@
#include "ephy-settings.h"
#include "ephy-shell.h"
#include "ephy-string.h"
-#include "ephy-toolbar.h"
#include "ephy-topic-action-group.h"
#include "ephy-topic-action.h"
@@ -67,7 +67,7 @@ find_bookmarks_menu (EphyWindow *window)
gint n_items, i;
/* Page menu */
- page_menu_button = ephy_toolbar_get_page_menu_button (EPHY_TOOLBAR (ephy_window_get_toolbar (window)));
+ page_menu_button = ephy_header_bar_get_page_menu_button (EPHY_HEADER_BAR (ephy_window_get_header_bar
(window)));
page_menu = gtk_menu_button_get_menu_model (GTK_MENU_BUTTON (page_menu_button));
/* Number of sections in the model */
@@ -234,7 +234,7 @@ ephy_bookmarks_ui_attach_window (EphyWindow *window)
G_CALLBACK (tree_changed_cb),
G_OBJECT (window), 0);
- page_menu_button = ephy_toolbar_get_page_menu_button (EPHY_TOOLBAR (ephy_window_get_toolbar (window)));
+ page_menu_button = ephy_header_bar_get_page_menu_button (EPHY_HEADER_BAR (ephy_window_get_header_bar
(window)));
g_signal_connect (GTK_WIDGET (page_menu_button), "button-press-event", G_CALLBACK
(activate_bookmarks_menu), window);
}
@@ -282,7 +282,7 @@ ephy_bookmarks_ui_detach_window (EphyWindow *window)
g_signal_handlers_disconnect_by_func
(G_OBJECT (eb), G_CALLBACK (tree_changed_cb), G_OBJECT (window));
- page_menu_button = ephy_toolbar_get_page_menu_button (EPHY_TOOLBAR (ephy_window_get_toolbar (window)));
+ page_menu_button = ephy_header_bar_get_page_menu_button (EPHY_HEADER_BAR (ephy_window_get_header_bar
(window)));
g_signal_handlers_disconnect_by_func (GTK_WIDGET (page_menu_button), G_CALLBACK (activate_bookmarks_menu),
window);
}
diff --git a/src/ephy-toolbar.c b/src/ephy-header-bar.c
similarity index 73%
rename from src/ephy-toolbar.c
rename to src/ephy-header-bar.c
index 97f7ed1..f7ea639 100644
--- a/src/ephy-toolbar.c
+++ b/src/ephy-header-bar.c
@@ -19,7 +19,7 @@
*/
#include "config.h"
-#include "ephy-toolbar.h"
+#include "ephy-header-bar.h"
#include "ephy-action-helper.h"
#include "ephy-downloads-popover.h"
@@ -50,7 +50,7 @@ static GParamSpec *object_properties[N_PROPERTIES] = { NULL, };
#define MAX_LABEL_LENGTH 48
#define HISTORY_ITEM_DATA_KEY "history-item-data-key"
-struct _EphyToolbar {
+struct _EphyHeaderBar {
GtkHeaderBar parent_instance;
EphyWindow *window;
@@ -67,72 +67,72 @@ struct _EphyToolbar {
guint navigation_buttons_menu_timeout;
};
-G_DEFINE_TYPE (EphyToolbar, ephy_toolbar, GTK_TYPE_HEADER_BAR)
+G_DEFINE_TYPE (EphyHeaderBar, ephy_header_bar, GTK_TYPE_HEADER_BAR)
static gboolean
-toolbar_is_for_active_window (EphyToolbar *toolbar)
+header_bar_is_for_active_window (EphyHeaderBar *header_bar)
{
EphyShell *shell = ephy_shell_get_default ();
GtkWindow *active_window;
active_window = gtk_application_get_active_window (GTK_APPLICATION (shell));
- return active_window == GTK_WINDOW (toolbar->window);
+ return active_window == GTK_WINDOW (header_bar->window);
}
static void
download_added_cb (EphyDownloadsManager *manager,
EphyDownload *download,
- EphyToolbar *toolbar)
+ EphyHeaderBar *header_bar)
{
- if (!toolbar->downloads_popover) {
- toolbar->downloads_popover = ephy_downloads_popover_new (toolbar->downloads_button);
- gtk_menu_button_set_popover (GTK_MENU_BUTTON (toolbar->downloads_button),
- toolbar->downloads_popover);
+ if (!header_bar->downloads_popover) {
+ header_bar->downloads_popover = ephy_downloads_popover_new (header_bar->downloads_button);
+ gtk_menu_button_set_popover (GTK_MENU_BUTTON (header_bar->downloads_button),
+ header_bar->downloads_popover);
}
- gtk_revealer_set_reveal_child (GTK_REVEALER (toolbar->downloads_revealer), TRUE);
+ gtk_revealer_set_reveal_child (GTK_REVEALER (header_bar->downloads_revealer), TRUE);
- if (toolbar_is_for_active_window (toolbar))
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toolbar->downloads_button), TRUE);
+ if (header_bar_is_for_active_window (header_bar))
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (header_bar->downloads_button), TRUE);
}
static void
download_completed_cb (EphyDownloadsManager *manager,
EphyDownload *download,
- EphyToolbar *toolbar)
+ EphyHeaderBar *header_bar)
{
- if (toolbar_is_for_active_window (toolbar))
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toolbar->downloads_button), TRUE);
+ if (header_bar_is_for_active_window (header_bar))
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (header_bar->downloads_button), TRUE);
}
static void
download_removed_cb (EphyDownloadsManager *manager,
EphyDownload *download,
- EphyToolbar *toolbar)
+ EphyHeaderBar *header_bar)
{
if (!ephy_downloads_manager_get_downloads (manager))
- gtk_revealer_set_reveal_child (GTK_REVEALER (toolbar->downloads_revealer), FALSE);
+ gtk_revealer_set_reveal_child (GTK_REVEALER (header_bar->downloads_revealer), FALSE);
}
static void
downloads_estimated_progress_cb (EphyDownloadsManager *manager,
- EphyToolbar *toolbar)
+ EphyHeaderBar *header_bar)
{
- gtk_widget_queue_draw (gtk_button_get_image (GTK_BUTTON (toolbar->downloads_button)));
+ gtk_widget_queue_draw (gtk_button_get_image (GTK_BUTTON (header_bar->downloads_button)));
}
static void
-ephy_toolbar_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
+ephy_header_bar_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- EphyToolbar *toolbar = EPHY_TOOLBAR (object);
+ EphyHeaderBar *header_bar = EPHY_HEADER_BAR (object);
switch (property_id) {
case PROP_WINDOW:
- toolbar->window = EPHY_WINDOW (g_value_get_object (value));
+ header_bar->window = EPHY_WINDOW (g_value_get_object (value));
g_object_notify_by_pspec (object, object_properties[PROP_WINDOW]);
break;
default:
@@ -141,16 +141,16 @@ ephy_toolbar_set_property (GObject *object,
}
static void
-ephy_toolbar_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
+ephy_header_bar_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- EphyToolbar *toolbar = EPHY_TOOLBAR (object);
+ EphyHeaderBar *header_bar = EPHY_HEADER_BAR (object);
switch (property_id) {
case PROP_WINDOW:
- g_value_set_object (value, toolbar->window);
+ g_value_set_object (value, header_bar->window);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -158,15 +158,15 @@ ephy_toolbar_get_property (GObject *object,
}
static void
-sync_chromes_visibility (EphyToolbar *toolbar)
+sync_chromes_visibility (EphyHeaderBar *header_bar)
{
EphyWindowChrome chrome;
- chrome = ephy_window_get_chrome (toolbar->window);
+ chrome = ephy_window_get_chrome (header_bar->window);
- gtk_widget_set_visible (toolbar->navigation_box, chrome & EPHY_WINDOW_CHROME_TOOLBAR);
- gtk_widget_set_visible (toolbar->page_menu_button, chrome & EPHY_WINDOW_CHROME_MENU);
- gtk_widget_set_visible (toolbar->new_tab_button, chrome & EPHY_WINDOW_CHROME_TABSBAR);
+ gtk_widget_set_visible (header_bar->navigation_box, chrome & EPHY_WINDOW_CHROME_HEADER_BAR);
+ gtk_widget_set_visible (header_bar->page_menu_button, chrome & EPHY_WINDOW_CHROME_MENU);
+ gtk_widget_set_visible (header_bar->new_tab_button, chrome & EPHY_WINDOW_CHROME_TABSBAR);
}
typedef enum {
@@ -430,7 +430,7 @@ navigation_button_press_event_cb (GtkButton *button,
GdkEvent *event,
gpointer user_data)
{
- EphyToolbar *toolbar = EPHY_TOOLBAR (user_data);
+ EphyHeaderBar *header_bar = EPHY_HEADER_BAR (user_data);
EphyNavigationHistoryDirection direction;
const gchar *action_name;
@@ -440,22 +440,22 @@ navigation_button_press_event_cb (GtkButton *button,
: EPHY_NAVIGATION_HISTORY_DIRECTION_FORWARD;
if (((GdkEventButton *)event)->button == GDK_BUTTON_SECONDARY) {
- popup_history_menu (GTK_WIDGET (button), toolbar->window,
+ popup_history_menu (GTK_WIDGET (button), header_bar->window,
direction, (GdkEventButton *)event);
} else {
PopupData *data;
data = g_new (PopupData, 1);
data->button = GTK_WIDGET (button);
- data->window = toolbar->window;
+ data->window = header_bar->window;
data->direction = direction;
data->event = (GdkEventButton *)event;
- toolbar->navigation_buttons_menu_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT, 500,
- (GSourceFunc)menu_timeout_cb,
- data,
- (GDestroyNotify)g_free);
- g_source_set_name_by_id (toolbar->navigation_buttons_menu_timeout, "[epiphany] menu_timeout_cb");
+ header_bar->navigation_buttons_menu_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT, 500,
+ (GSourceFunc)menu_timeout_cb,
+ data,
+ (GDestroyNotify)g_free);
+ g_source_set_name_by_id (header_bar->navigation_buttons_menu_timeout, "[epiphany] menu_timeout_cb");
}
return FALSE;
@@ -466,19 +466,19 @@ navigation_button_release_event_cb (GtkButton *button,
GdkEvent *event,
gpointer user_data)
{
- EphyToolbar *toolbar = EPHY_TOOLBAR (user_data);
+ EphyHeaderBar *header_bar = EPHY_HEADER_BAR (user_data);
GActionGroup *action_group;
GAction *action;
EphyNavigationHistoryDirection direction;
const gchar *action_name;
- if (toolbar->navigation_buttons_menu_timeout > 0) {
- g_source_remove (toolbar->navigation_buttons_menu_timeout);
- toolbar->navigation_buttons_menu_timeout = 0;
+ if (header_bar->navigation_buttons_menu_timeout > 0) {
+ g_source_remove (header_bar->navigation_buttons_menu_timeout);
+ header_bar->navigation_buttons_menu_timeout = 0;
}
action_name = gtk_actionable_get_action_name (GTK_ACTIONABLE (button));
- action_group = gtk_widget_get_action_group (GTK_WIDGET (toolbar->window), "toolbar");
+ action_group = gtk_widget_get_action_group (GTK_WIDGET (header_bar->window), "toolbar");
direction = strstr (action_name, "back") == 0 ? EPHY_NAVIGATION_HISTORY_DIRECTION_BACK
: EPHY_NAVIGATION_HISTORY_DIRECTION_FORWARD;
@@ -496,7 +496,7 @@ navigation_button_release_event_cb (GtkButton *button,
}
break;
case GDK_BUTTON_SECONDARY:
- popup_history_menu (GTK_WIDGET (button), toolbar->window,
+ popup_history_menu (GTK_WIDGET (button), header_bar->window,
direction, (GdkEventButton *)event);
break;
default:
@@ -511,23 +511,23 @@ navigation_leave_notify_event_cb (GtkButton *button,
GdkEvent *event,
gpointer user_data)
{
- EphyToolbar *toolbar = EPHY_TOOLBAR (user_data);
+ EphyHeaderBar *header_bar = EPHY_HEADER_BAR (user_data);
- if (toolbar->navigation_buttons_menu_timeout > 0) {
- g_source_remove (toolbar->navigation_buttons_menu_timeout);
- toolbar->navigation_buttons_menu_timeout = 0;
+ if (header_bar->navigation_buttons_menu_timeout > 0) {
+ g_source_remove (header_bar->navigation_buttons_menu_timeout);
+ header_bar->navigation_buttons_menu_timeout = 0;
}
return G_SOURCE_REMOVE;
}
void
-ephy_toolbar_change_combined_stop_reload_state (GSimpleAction *action,
- GVariant *loading,
- gpointer user_data)
+ephy_header_bar_change_combined_stop_reload_state (GSimpleAction *action,
+ GVariant *loading,
+ gpointer user_data)
{
EphyWindow *window = EPHY_WINDOW (user_data);
- EphyToolbar *toolbar;
+ EphyHeaderBar *header_bar;
GtkWidget *image;
if (g_variant_get_boolean (loading))
@@ -537,15 +537,15 @@ ephy_toolbar_change_combined_stop_reload_state (GSimpleAction *action,
image = gtk_image_new_from_icon_name ("view-refresh-symbolic",
GTK_ICON_SIZE_BUTTON);
- toolbar = EPHY_TOOLBAR (ephy_window_get_toolbar (window));
- gtk_button_set_image (GTK_BUTTON (toolbar->combined_stop_reload_button),
+ header_bar = EPHY_HEADER_BAR (ephy_window_get_header_bar (window));
+ gtk_button_set_image (GTK_BUTTON (header_bar->combined_stop_reload_button),
image);
}
static void
-ephy_toolbar_constructed (GObject *object)
+ephy_header_bar_constructed (GObject *object)
{
- EphyToolbar *toolbar = EPHY_TOOLBAR (object);
+ EphyHeaderBar *header_bar = EPHY_HEADER_BAR (object);
GtkWidget *box, *button;
GtkMenu *menu;
GMenu *page_menu;
@@ -553,14 +553,14 @@ ephy_toolbar_constructed (GObject *object)
GtkBuilder *builder;
EphyHistoryService *history_service;
- G_OBJECT_CLASS (ephy_toolbar_parent_class)->constructed (object);
+ G_OBJECT_CLASS (ephy_header_bar_parent_class)->constructed (object);
- g_signal_connect_swapped (toolbar->window, "notify::chrome",
- G_CALLBACK (sync_chromes_visibility), toolbar);
+ g_signal_connect_swapped (header_bar->window, "notify::chrome",
+ G_CALLBACK (sync_chromes_visibility), header_bar);
/* Back and Forward */
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- toolbar->navigation_box = box;
+ header_bar->navigation_box = box;
/* Back */
button = gtk_button_new ();
@@ -571,11 +571,11 @@ ephy_toolbar_constructed (GObject *object)
gtk_actionable_set_action_name (GTK_ACTIONABLE (button),
"toolbar.navigation-back");
g_signal_connect (button, "button-press-event",
- G_CALLBACK (navigation_button_press_event_cb), toolbar);
+ G_CALLBACK (navigation_button_press_event_cb), header_bar);
g_signal_connect (button, "button-release-event",
- G_CALLBACK (navigation_button_release_event_cb), toolbar);
+ G_CALLBACK (navigation_button_release_event_cb), header_bar);
g_signal_connect (button, "leave-notify-event",
- G_CALLBACK (navigation_leave_notify_event_cb), toolbar);
+ G_CALLBACK (navigation_leave_notify_event_cb), header_bar);
gtk_container_add (GTK_CONTAINER (box), button);
gtk_widget_show (GTK_WIDGET (button));
@@ -588,11 +588,11 @@ ephy_toolbar_constructed (GObject *object)
gtk_actionable_set_action_name (GTK_ACTIONABLE (button),
"toolbar.navigation-forward");
g_signal_connect (button, "button-press-event",
- G_CALLBACK (navigation_button_press_event_cb), toolbar);
+ G_CALLBACK (navigation_button_press_event_cb), header_bar);
g_signal_connect (button, "button-release-event",
- G_CALLBACK (navigation_button_release_event_cb), toolbar);
+ G_CALLBACK (navigation_button_release_event_cb), header_bar);
g_signal_connect (button, "leave-notify-event",
- G_CALLBACK (navigation_leave_notify_event_cb), toolbar);
+ G_CALLBACK (navigation_leave_notify_event_cb), header_bar);
gtk_container_add (GTK_CONTAINER (box), button);
gtk_widget_show (GTK_WIDGET (button));
@@ -601,11 +601,11 @@ ephy_toolbar_constructed (GObject *object)
gtk_style_context_add_class (gtk_widget_get_style_context (box),
"linked");
- gtk_header_bar_pack_start (GTK_HEADER_BAR (toolbar), box);
+ gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), box);
/* Reload/Stop */
button = gtk_button_new ();
- toolbar->combined_stop_reload_button = button;
+ header_bar->combined_stop_reload_button = button;
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_icon_name ("view-refresh-symbolic", GTK_ICON_SIZE_BUTTON));
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
@@ -614,26 +614,26 @@ ephy_toolbar_constructed (GObject *object)
gtk_style_context_add_class (gtk_widget_get_style_context (button),
"image-button");
gtk_widget_show (GTK_WIDGET (button));
- gtk_header_bar_pack_start (GTK_HEADER_BAR (toolbar), button);
+ gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), button);
/* New Tab */
button = gtk_button_new ();
- toolbar->new_tab_button = button;
+ header_bar->new_tab_button = button;
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_icon_name ("tab-new-symbolic", GTK_ICON_SIZE_BUTTON));
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_actionable_set_action_name (GTK_ACTIONABLE (button), "win.new-tab");
- gtk_header_bar_pack_start (GTK_HEADER_BAR (toolbar), button);
+ gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), button);
/* Location bar + Title */
- toolbar->title_box = ephy_title_box_new (toolbar->window);
- toolbar->entry = ephy_title_box_get_location_entry (toolbar->title_box);
- gtk_header_bar_set_custom_title (GTK_HEADER_BAR (toolbar), GTK_WIDGET (toolbar->title_box));
- gtk_widget_show (GTK_WIDGET (toolbar->title_box));
+ header_bar->title_box = ephy_title_box_new (header_bar->window);
+ header_bar->entry = ephy_title_box_get_location_entry (header_bar->title_box);
+ gtk_header_bar_set_custom_title (GTK_HEADER_BAR (header_bar), GTK_WIDGET (header_bar->title_box));
+ gtk_widget_show (GTK_WIDGET (header_bar->title_box));
/* Page Menu */
button = gtk_menu_button_new ();
- toolbar->page_menu_button = button;
+ header_bar->page_menu_button = button;
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_icon_name ("open-menu-symbolic", GTK_ICON_SIZE_BUTTON));
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
@@ -646,26 +646,26 @@ ephy_toolbar_constructed (GObject *object)
menu = gtk_menu_button_get_popup (GTK_MENU_BUTTON (button));
gtk_widget_set_halign (GTK_WIDGET (menu), GTK_ALIGN_END);
- gtk_header_bar_pack_end (GTK_HEADER_BAR (toolbar), button);
+ gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), button);
/* Downloads */
downloads_manager = ephy_embed_shell_get_downloads_manager (ephy_embed_shell_get_default ());
- toolbar->downloads_revealer = gtk_revealer_new ();
- gtk_revealer_set_transition_type (GTK_REVEALER (toolbar->downloads_revealer),
GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
- gtk_revealer_set_reveal_child (GTK_REVEALER (toolbar->downloads_revealer),
+ header_bar->downloads_revealer = gtk_revealer_new ();
+ gtk_revealer_set_transition_type (GTK_REVEALER (header_bar->downloads_revealer),
GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
+ gtk_revealer_set_reveal_child (GTK_REVEALER (header_bar->downloads_revealer),
ephy_downloads_manager_get_downloads (downloads_manager) != NULL);
- toolbar->downloads_button = gtk_menu_button_new ();
- gtk_button_set_image (GTK_BUTTON (toolbar->downloads_button), ephy_downloads_progress_icon_new ());
- gtk_widget_set_valign (toolbar->downloads_button, GTK_ALIGN_CENTER);
- gtk_container_add (GTK_CONTAINER (toolbar->downloads_revealer), toolbar->downloads_button);
- gtk_widget_show (toolbar->downloads_button);
+ header_bar->downloads_button = gtk_menu_button_new ();
+ gtk_button_set_image (GTK_BUTTON (header_bar->downloads_button), ephy_downloads_progress_icon_new ());
+ gtk_widget_set_valign (header_bar->downloads_button, GTK_ALIGN_CENTER);
+ gtk_container_add (GTK_CONTAINER (header_bar->downloads_revealer), header_bar->downloads_button);
+ gtk_widget_show (header_bar->downloads_button);
if (ephy_downloads_manager_get_downloads (downloads_manager)) {
- toolbar->downloads_popover = ephy_downloads_popover_new (toolbar->downloads_button);
- gtk_menu_button_set_popover (GTK_MENU_BUTTON (toolbar->downloads_button),
- toolbar->downloads_popover);
+ header_bar->downloads_popover = ephy_downloads_popover_new (header_bar->downloads_button);
+ gtk_menu_button_set_popover (GTK_MENU_BUTTON (header_bar->downloads_button),
+ header_bar->downloads_popover);
}
g_signal_connect_object (downloads_manager, "download-added",
@@ -681,48 +681,48 @@ ephy_toolbar_constructed (GObject *object)
G_CALLBACK (downloads_estimated_progress_cb),
object, 0);
- gtk_header_bar_pack_end (GTK_HEADER_BAR (toolbar), toolbar->downloads_revealer);
- gtk_widget_show (toolbar->downloads_revealer);
+ gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), header_bar->downloads_revealer);
+ gtk_widget_show (header_bar->downloads_revealer);
history_service = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service
(ephy_embed_shell_get_default ()));
g_signal_connect (history_service,
"cleared", G_CALLBACK (ephy_history_cleared_cb),
- toolbar->window);
+ header_bar->window);
}
static void
-ephy_toolbar_init (EphyToolbar *toolbar)
+ephy_header_bar_init (EphyHeaderBar *header_bar)
{
}
static void
-ephy_toolbar_dispose (GObject *object)
+ephy_header_bar_dispose (GObject *object)
{
- EphyToolbar *toolbar = EPHY_TOOLBAR (object);
+ EphyHeaderBar *header_bar = EPHY_HEADER_BAR (object);
- if (toolbar->navigation_buttons_menu_timeout > 0) {
- g_source_remove (toolbar->navigation_buttons_menu_timeout);
- toolbar->navigation_buttons_menu_timeout = 0;
+ if (header_bar->navigation_buttons_menu_timeout > 0) {
+ g_source_remove (header_bar->navigation_buttons_menu_timeout);
+ header_bar->navigation_buttons_menu_timeout = 0;
}
- G_OBJECT_CLASS (ephy_toolbar_parent_class)->dispose (object);
+ G_OBJECT_CLASS (ephy_header_bar_parent_class)->dispose (object);
}
static void
-ephy_toolbar_class_init (EphyToolbarClass *klass)
+ephy_header_bar_class_init (EphyHeaderBarClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->dispose = ephy_toolbar_dispose;
- gobject_class->set_property = ephy_toolbar_set_property;
- gobject_class->get_property = ephy_toolbar_get_property;
- gobject_class->constructed = ephy_toolbar_constructed;
+ gobject_class->dispose = ephy_header_bar_dispose;
+ gobject_class->set_property = ephy_header_bar_set_property;
+ gobject_class->get_property = ephy_header_bar_get_property;
+ gobject_class->constructed = ephy_header_bar_constructed;
object_properties[PROP_WINDOW] =
g_param_spec_object ("window",
"Window",
- "The toolbar's EphyWindow",
+ "The header_bar's EphyWindow",
EPHY_TYPE_WINDOW,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
@@ -732,36 +732,36 @@ ephy_toolbar_class_init (EphyToolbarClass *klass)
}
GtkWidget *
-ephy_toolbar_new (EphyWindow *window)
+ephy_header_bar_new (EphyWindow *window)
{
g_return_val_if_fail (EPHY_IS_WINDOW (window), NULL);
- return GTK_WIDGET (g_object_new (EPHY_TYPE_TOOLBAR,
+ return GTK_WIDGET (g_object_new (EPHY_TYPE_HEADER_BAR,
"show-close-button", TRUE,
"window", window,
NULL));
}
GtkWidget *
-ephy_toolbar_get_location_entry (EphyToolbar *toolbar)
+ephy_header_bar_get_location_entry (EphyHeaderBar *header_bar)
{
- return toolbar->entry;
+ return header_bar->entry;
}
EphyTitleBox *
-ephy_toolbar_get_title_box (EphyToolbar *toolbar)
+ephy_header_bar_get_title_box (EphyHeaderBar *header_bar)
{
- return toolbar->title_box;
+ return header_bar->title_box;
}
GtkWidget *
-ephy_toolbar_get_page_menu_button (EphyToolbar *toolbar)
+ephy_header_bar_get_page_menu_button (EphyHeaderBar *header_bar)
{
- return toolbar->page_menu_button;
+ return header_bar->page_menu_button;
}
GtkWidget *
-ephy_toolbar_get_new_tab_button (EphyToolbar *toolbar)
+ephy_header_bar_get_new_tab_button (EphyHeaderBar *header_bar)
{
- return toolbar->new_tab_button;
+ return header_bar->new_tab_button;
}
diff --git a/src/ephy-toolbar.h b/src/ephy-header-bar.h
similarity index 50%
rename from src/ephy-toolbar.h
rename to src/ephy-header-bar.h
index af10200..f55ab2b 100644
--- a/src/ephy-toolbar.h
+++ b/src/ephy-header-bar.h
@@ -25,19 +25,19 @@
G_BEGIN_DECLS
-#define EPHY_TYPE_TOOLBAR (ephy_toolbar_get_type())
+#define EPHY_TYPE_HEADER_BAR (ephy_header_bar_get_type())
-G_DECLARE_FINAL_TYPE (EphyToolbar, ephy_toolbar, EPHY, TOOLBAR, GtkHeaderBar)
+G_DECLARE_FINAL_TYPE (EphyHeaderBar, ephy_header_bar, EPHY, HEADER_BAR, GtkHeaderBar)
-GtkWidget *ephy_toolbar_new (EphyWindow *window);
+GtkWidget *ephy_header_bar_new (EphyWindow *window);
-void ephy_toolbar_change_combined_stop_reload_state (GSimpleAction *action,
- GVariant *state,
- gpointer user_data);
+void ephy_header_bar_change_combined_stop_reload_state (GSimpleAction *action,
+ GVariant *state,
+ gpointer user_data);
-GtkWidget *ephy_toolbar_get_location_entry (EphyToolbar *toolbar);
-EphyTitleBox *ephy_toolbar_get_title_box (EphyToolbar *toolbar);
-GtkWidget *ephy_toolbar_get_page_menu_button (EphyToolbar *toolbar);
-GtkWidget *ephy_toolbar_get_new_tab_button (EphyToolbar *toolbar);
+GtkWidget *ephy_header_bar_get_location_entry (EphyHeaderBar *header_bar);
+EphyTitleBox *ephy_header_bar_get_title_box (EphyHeaderBar *header_bar);
+GtkWidget *ephy_header_bar_get_page_menu_button (EphyHeaderBar *header_bar);
+GtkWidget *ephy_header_bar_get_new_tab_button (EphyHeaderBar *header_bar);
G_END_DECLS
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 025053b..e938e96 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -33,6 +33,7 @@
#include "ephy-file-helpers.h"
#include "ephy-find-toolbar.h"
#include "ephy-gui.h"
+#include "ephy-header-bar.h"
#include "ephy-initial-state.h"
#include "ephy-link.h"
#include "ephy-link-action.h"
@@ -45,7 +46,6 @@
#include "ephy-settings.h"
#include "ephy-shell.h"
#include "ephy-title-box.h"
-#include "ephy-toolbar.h"
#include "ephy-type-builtins.h"
#include "ephy-web-view.h"
#include "ephy-zoom.h"
@@ -138,7 +138,7 @@ const struct {
struct _EphyWindow {
GtkApplicationWindow parent_instance;
- GtkWidget *toolbar;
+ GtkWidget *header_bar;
GHashTable *action_labels;
GtkNotebook *notebook;
EphyEmbed *active_embed;
@@ -500,7 +500,7 @@ sync_tab_security (EphyWebView *view,
if (window->closing) return;
ephy_web_view_get_security_level (view, &security_level, NULL, NULL);
- title_box = ephy_toolbar_get_title_box (EPHY_TOOLBAR (window->toolbar));
+ title_box = ephy_header_bar_get_title_box (EPHY_HEADER_BAR (window->header_bar));
ephy_title_box_set_security_level (title_box, security_level);
}
@@ -517,7 +517,7 @@ ephy_window_fullscreen (EphyWindow *window)
sync_tab_security (ephy_embed_get_web_view (embed), NULL, window);
sync_chromes_visibility (window);
- gtk_widget_hide (window->toolbar);
+ gtk_widget_hide (window->header_bar);
ephy_embed_entering_fullscreen (embed);
}
@@ -526,7 +526,7 @@ ephy_window_unfullscreen (EphyWindow *window)
{
window->fullscreen_mode = FALSE;
- gtk_widget_show (window->toolbar);
+ gtk_widget_show (window->header_bar);
sync_chromes_visibility (window);
ephy_embed_leaving_fullscreen (window->active_embed);
}
@@ -700,7 +700,7 @@ update_edit_actions_sensitivity (EphyWindow *window, gboolean hide)
GtkWidget *entry;
gboolean has_selection;
- entry = ephy_toolbar_get_location_entry (EPHY_TOOLBAR (window->toolbar));
+ entry = ephy_header_bar_get_location_entry (EPHY_HEADER_BAR (window->header_bar));
has_selection = gtk_editable_get_selection_bounds
(GTK_EDITABLE (widget), NULL, NULL);
@@ -786,7 +786,7 @@ init_menu_updaters (EphyWindow *window)
{
GtkWidget *page_menu;
- page_menu = ephy_toolbar_get_page_menu_button (EPHY_TOOLBAR (window->toolbar));
+ page_menu = ephy_header_bar_get_page_menu_button (EPHY_HEADER_BAR (window->header_bar));
g_signal_connect (page_menu, "toggled",
G_CALLBACK (edit_menu_toggle_cb), window);
@@ -848,7 +848,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_toolbar_change_combined_stop_reload_state }
+ { "combined-stop-reload", window_cmd_combined_stop_reload, NULL, "false",
ephy_header_bar_change_combined_stop_reload_state }
};
static const GActionEntry popup_entries [] = {
@@ -1783,12 +1783,12 @@ ephy_window_configure_for_view (EphyWindow *window,
properties = webkit_web_view_get_window_properties (web_view);
if (webkit_window_properties_get_toolbar_visible (properties))
- chrome |= EPHY_WINDOW_CHROME_TOOLBAR;
+ chrome |= EPHY_WINDOW_CHROME_HEADER_BAR;
if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_APPLICATION) {
GtkWidget *entry;
- entry = ephy_toolbar_get_location_entry (EPHY_TOOLBAR (window->toolbar));
+ entry = ephy_header_bar_get_location_entry (EPHY_HEADER_BAR (window->header_bar));
gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE);
if (webkit_window_properties_get_menubar_visible (properties))
@@ -2553,7 +2553,7 @@ notebook_switch_page_cb (GtkNotebook *notebook,
/* update new tab */
ephy_window_set_active_tab (window, embed);
- ephy_title_box_set_web_view (ephy_toolbar_get_title_box (EPHY_TOOLBAR (window->toolbar)),
+ ephy_title_box_set_web_view (ephy_header_bar_get_title_box (EPHY_HEADER_BAR (window->header_bar)),
EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed));
}
@@ -2759,7 +2759,7 @@ open_security_popover (EphyWindow *window,
view = ephy_embed_get_web_view (window->active_embed);
ephy_web_view_get_security_level (view, &security_level, &certificate, &tls_errors);
- location_entry = ephy_toolbar_get_location_entry (EPHY_TOOLBAR (window->toolbar));
+ location_entry = ephy_header_bar_get_location_entry (EPHY_HEADER_BAR (window->header_bar));
security_popover = ephy_security_popover_new (relative_to,
ephy_location_entry_get_location (EPHY_LOCATION_ENTRY
(location_entry)),
@@ -2782,7 +2782,7 @@ location_controller_lock_clicked_cb (EphyLocationController *controller,
GtkWidget *location_entry;
GdkRectangle lock_position;
- location_entry = ephy_toolbar_get_location_entry (EPHY_TOOLBAR (window->toolbar));
+ location_entry = ephy_header_bar_get_location_entry (EPHY_HEADER_BAR (window->header_bar));
gtk_entry_get_icon_area (GTK_ENTRY (location_entry), GTK_ENTRY_ICON_SECONDARY, &lock_position);
open_security_popover (window, location_entry, &lock_position);
}
@@ -2798,38 +2798,38 @@ title_box_lock_clicked_cb (EphyTitleBox *title_box,
}
static GtkWidget *
-setup_toolbar (EphyWindow *window)
+setup_header_bar (EphyWindow *window)
{
- GtkWidget *toolbar;
+ GtkWidget *header_bar;
EphyEmbedShellMode app_mode;
EphyTitleBox *title_box;
- toolbar = ephy_toolbar_new (window);
- gtk_window_set_titlebar (GTK_WINDOW (window), toolbar);
- gtk_widget_show (toolbar);
+ header_bar = ephy_header_bar_new (window);
+ gtk_window_set_titlebar (GTK_WINDOW (window), header_bar);
+ gtk_widget_show (header_bar);
app_mode = ephy_embed_shell_get_mode (ephy_embed_shell_get_default ());
if (app_mode == EPHY_EMBED_SHELL_MODE_INCOGNITO)
- gtk_style_context_add_class (gtk_widget_get_style_context (toolbar), "incognito-mode");
+ gtk_style_context_add_class (gtk_widget_get_style_context (header_bar), "incognito-mode");
- title_box = ephy_toolbar_get_title_box (EPHY_TOOLBAR (toolbar));
+ title_box = ephy_header_bar_get_title_box (EPHY_HEADER_BAR (header_bar));
g_signal_connect (title_box, "lock-clicked",
G_CALLBACK (title_box_lock_clicked_cb), window);
- return toolbar;
+ return header_bar;
}
static EphyLocationController *
-setup_location_controller (EphyWindow *window,
- EphyToolbar *toolbar)
+setup_location_controller (EphyWindow *window,
+ EphyHeaderBar *header_bar)
{
EphyLocationController *location_controller;
location_controller =
g_object_new (EPHY_TYPE_LOCATION_CONTROLLER,
"window", window,
- "location-entry", ephy_toolbar_get_location_entry (toolbar),
- "title-box", ephy_toolbar_get_title_box (toolbar),
+ "location-entry", ephy_header_bar_get_location_entry (header_bar),
+ "title-box", ephy_header_bar_get_title_box (header_bar),
NULL);
g_signal_connect (location_controller, "notify::address",
G_CALLBACK (sync_user_input_cb), window);
@@ -2982,8 +2982,8 @@ ephy_window_constructor (GType type,
window->notebook = setup_notebook (window);
/* Setup the toolbar. */
- window->toolbar = setup_toolbar (window);
- window->location_controller = setup_location_controller (window, EPHY_TOOLBAR (window->toolbar));
+ window->header_bar = setup_header_bar (window);
+ window->location_controller = setup_location_controller (window, EPHY_HEADER_BAR (window->header_bar));
gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (window->notebook));
gtk_widget_show (GTK_WIDGET (window->notebook));
@@ -3042,8 +3042,8 @@ ephy_window_constructor (GType type,
/* We don't need to show the page menu and the new tab button in web
* application mode.
*/
- gtk_widget_set_visible (ephy_toolbar_get_page_menu_button (EPHY_TOOLBAR (window->toolbar)), FALSE);
- gtk_widget_set_visible (ephy_toolbar_get_new_tab_button (EPHY_TOOLBAR (window->toolbar)), FALSE);
+ gtk_widget_set_visible (ephy_header_bar_get_page_menu_button (EPHY_HEADER_BAR (window->header_bar)),
FALSE);
+ gtk_widget_set_visible (ephy_header_bar_get_new_tab_button (EPHY_HEADER_BAR (window->header_bar)),
FALSE);
new_action = g_action_map_lookup_action (G_ACTION_MAP (action_group), "context-bookmark-page");
ephy_action_change_sensitivity_flags (G_SIMPLE_ACTION (new_action), SENS_FLAG_CHROME, TRUE);
@@ -3201,7 +3201,7 @@ ephy_window_load_url (EphyWindow *window,
* ephy_window_activate_location:
* @window: an #EphyWindow
*
- * Activates the location entry on @window's toolbar.
+ * Activates the location entry on @window's header bar.
**/
void
ephy_window_activate_location (EphyWindow *window)
@@ -3211,10 +3211,10 @@ ephy_window_activate_location (EphyWindow *window)
if (!(window->chrome & EPHY_WINDOW_CHROME_LOCATION))
return;
- ephy_title_box_set_mode (ephy_toolbar_get_title_box (EPHY_TOOLBAR (window->toolbar)),
+ ephy_title_box_set_mode (ephy_header_bar_get_title_box (EPHY_HEADER_BAR (window->header_bar)),
EPHY_TITLE_BOX_MODE_LOCATION_ENTRY);
- entry = ephy_toolbar_get_location_entry (EPHY_TOOLBAR (window->toolbar));
+ entry = ephy_header_bar_get_location_entry (EPHY_HEADER_BAR (window->header_bar));
ephy_location_entry_activate (EPHY_LOCATION_ENTRY (entry));
}
@@ -3340,17 +3340,17 @@ ephy_window_get_location_controller (EphyWindow *window)
}
/**
- * ephy_window_get_toolbar:
+ * ephy_window_get_header_bar:
* @window: an #EphyWindow
*
- * Returns the @window #EphyToolbar
+ * Returns the @window #EphyHeaderBar
*
- * Returns: (transfer none): the @window #EphyToolbar
+ * Returns: (transfer none): the @window #EphyHeaderBar
**/
GtkWidget *
-ephy_window_get_toolbar (EphyWindow *window)
+ephy_window_get_header_bar (EphyWindow *window)
{
- return window->toolbar;
+ return window->header_bar;
}
typedef struct {
diff --git a/src/ephy-window.h b/src/ephy-window.h
index a1acab1..569d227 100644
--- a/src/ephy-window.h
+++ b/src/ephy-window.h
@@ -29,11 +29,11 @@ G_DECLARE_FINAL_TYPE (EphyWindow, ephy_window, EPHY, WINDOW, GtkApplicationWindo
typedef enum
{
- EPHY_WINDOW_CHROME_TOOLBAR = 1 << 0,
+ EPHY_WINDOW_CHROME_HEADER_BAR = 1 << 0,
EPHY_WINDOW_CHROME_MENU = 1 << 1,
EPHY_WINDOW_CHROME_LOCATION = 1 << 2,
EPHY_WINDOW_CHROME_TABSBAR = 1 << 3,
- EPHY_WINDOW_CHROME_DEFAULT = (EPHY_WINDOW_CHROME_TOOLBAR | EPHY_WINDOW_CHROME_MENU |
EPHY_WINDOW_CHROME_LOCATION | EPHY_WINDOW_CHROME_TABSBAR)
+ EPHY_WINDOW_CHROME_DEFAULT = (EPHY_WINDOW_CHROME_HEADER_BAR | EPHY_WINDOW_CHROME_MENU |
EPHY_WINDOW_CHROME_LOCATION | EPHY_WINDOW_CHROME_TABSBAR)
} EphyWindowChrome;
EphyWindow *ephy_window_new (void);
@@ -49,7 +49,7 @@ void ephy_window_set_zoom (EphyWindow *window,
void ephy_window_activate_location (EphyWindow *window);
const char *ephy_window_get_location (EphyWindow *window);
-GtkWidget *ephy_window_get_toolbar (EphyWindow *window);
+GtkWidget *ephy_window_get_header_bar (EphyWindow *window);
gboolean ephy_window_close (EphyWindow *window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]