diff options
author | Alexander Mikhaylenko <alexm@gnome.org> | 2021-01-28 19:50:22 +0500 |
---|---|---|
committer | Alexander Mikhaylenko <alexm@gnome.org> | 2021-01-28 20:31:19 +0500 |
commit | b820125b0923127724f3348fbb9823918be1d48d (patch) | |
tree | b2bfb4d5c6e895a14aa26274f2919d9511e25cd4 | |
parent | b7b20b64e7670697e8a0a68f6472bff705fde13c (diff) | |
download | epiphany-b820125b0923127724f3348fbb9823918be1d48d.tar.gz |
Remove tabs-bar-position setting
It was originally added to see more tabs at once; we have a popover for
that now.
The upcoming new tab bar won't support positioning it like that, so let's
remove the setting beforehand.
-rw-r--r-- | data/org.gnome.epiphany.gschema.xml | 5 | ||||
-rw-r--r-- | lib/ephy-prefs.h | 9 | ||||
-rw-r--r-- | src/ephy-notebook.c | 67 |
3 files changed, 0 insertions, 81 deletions
diff --git a/data/org.gnome.epiphany.gschema.xml b/data/org.gnome.epiphany.gschema.xml index 1ef7cbfb3..a82713bda 100644 --- a/data/org.gnome.epiphany.gschema.xml +++ b/data/org.gnome.epiphany.gschema.xml @@ -83,11 +83,6 @@ <summary>Expand tabs size to fill the available space on the tabs bar.</summary> <description>If enabled the tabs will expand to use the entire available space in the tabs bar. This setting is ignored in Pantheon desktop.</description> </key> - <key name="tabs-bar-position" enum="org.gnome.Epiphany.EphyPrefsUITabsBarPosition"> - <default>'top'</default> - <summary>The position of the tabs bar.</summary> - <description>Controls where the tabs bar is shown. Possible values are “top” (the default), “bottom”, “left” (vertical tabs with bar on the left) and “right” (vertical tabs with bar on the right).</description> - </key> <key name="tabs-bar-visibility-policy" enum="org.gnome.Epiphany.EphyPrefsUITabsBarVisibilityPolicy"> <default>'more-than-one'</default> <summary>The visibility policy for the tabs bar.</summary> diff --git a/lib/ephy-prefs.h b/lib/ephy-prefs.h index b6d219136..dc7d491f5 100644 --- a/lib/ephy-prefs.h +++ b/lib/ephy-prefs.h @@ -25,14 +25,6 @@ G_BEGIN_DECLS typedef enum { - EPHY_PREFS_UI_TABS_BAR_POSITION_TOP, - EPHY_PREFS_UI_TABS_BAR_POSITION_BOTTOM, - EPHY_PREFS_UI_TABS_BAR_POSITION_LEFT, - EPHY_PREFS_UI_TABS_BAR_POSITION_RIGHT -} EphyPrefsUITabsBarPosition; - -typedef enum -{ EPHY_PREFS_READER_FONT_STYLE_SANS, EPHY_PREFS_READER_FONT_STYLE_SERIF, } EphyPrefsReaderFontStyle; @@ -66,7 +58,6 @@ typedef enum #define EPHY_PREFS_UI_SCHEMA "org.gnome.Epiphany.ui" #define EPHY_PREFS_UI_EXPAND_TABS_BAR "expand-tabs-bar" -#define EPHY_PREFS_UI_TABS_BAR_POSITION "tabs-bar-position" #define EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY "tabs-bar-visibility-policy" #define EPHY_PREFS_UI_KEEP_WINDOW_OPEN "keep-window-open" diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index 21828657b..701d77403 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -419,66 +419,6 @@ expand_tabs_changed_cb (GSettings *settings, g_list_free (tabs); } -static GtkPositionType -ephy_settings_get_tabs_bar_position (void) -{ - EphyPrefsUITabsBarPosition position; - position = g_settings_get_enum (EPHY_SETTINGS_UI, - EPHY_PREFS_UI_TABS_BAR_POSITION); - - switch (position) { - case EPHY_PREFS_UI_TABS_BAR_POSITION_TOP: - return GTK_POS_TOP; - case EPHY_PREFS_UI_TABS_BAR_POSITION_BOTTOM: - return GTK_POS_BOTTOM; - case EPHY_PREFS_UI_TABS_BAR_POSITION_LEFT: - return GTK_POS_LEFT; - case EPHY_PREFS_UI_TABS_BAR_POSITION_RIGHT: - return GTK_POS_RIGHT; - default: - g_assert_not_reached (); - } -} - -static void -box_set_halign (GtkWidget *box, - GtkPositionType type) -{ - switch (type) { - case GTK_POS_LEFT: - case GTK_POS_RIGHT: - gtk_widget_set_halign (box, GTK_ALIGN_FILL); - break; - case GTK_POS_TOP: - case GTK_POS_BOTTOM: - gtk_widget_set_halign (box, GTK_ALIGN_CENTER); - break; - default: - break; - } -} - -static void -position_changed_cb (GSettings *settings, - char *key, - EphyNotebook *nb) -{ - GtkPositionType type = ephy_settings_get_tabs_bar_position (); - gint pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb)); - gint i; - - /* Update halign of all notebook label widgets (sub-box) */ - for (i = 0; i < pages; i++) { - GtkWidget *child = gtk_notebook_get_nth_page (GTK_NOTEBOOK (nb), i); - GtkWidget *label_widget = gtk_notebook_get_tab_label (GTK_NOTEBOOK (nb), child); - GtkWidget *box = gtk_container_get_children (GTK_CONTAINER (label_widget))->data; - - box_set_halign (box, type); - } - - gtk_notebook_set_tab_pos (GTK_NOTEBOOK (nb), type); -} - static void show_tabs_changed_cb (GSettings *settings, char *key, @@ -562,7 +502,6 @@ ephy_notebook_init (EphyNotebook *notebook) gtk_notebook_set_show_border (gnotebook, FALSE); gtk_notebook_set_show_tabs (gnotebook, FALSE); gtk_notebook_set_group_name (gnotebook, EPHY_NOTEBOOK_TAB_GROUP_ID); - gtk_notebook_set_tab_pos (gnotebook, ephy_settings_get_tabs_bar_position ()); notebook->tabs_allowed = TRUE; @@ -587,9 +526,6 @@ ephy_notebook_init (EphyNotebook *notebook) "changed::" EPHY_PREFS_UI_EXPAND_TABS_BAR, G_CALLBACK (expand_tabs_changed_cb), notebook); g_signal_connect (EPHY_SETTINGS_UI, - "changed::" EPHY_PREFS_UI_TABS_BAR_POSITION, - G_CALLBACK (position_changed_cb), notebook); - g_signal_connect (EPHY_SETTINGS_UI, "changed::" EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY, G_CALLBACK (show_tabs_changed_cb), notebook); @@ -640,9 +576,6 @@ ephy_notebook_finalize (GObject *object) expand_tabs_changed_cb, notebook); g_signal_handlers_disconnect_by_func (EPHY_SETTINGS_UI, - position_changed_cb, - notebook); - g_signal_handlers_disconnect_by_func (EPHY_SETTINGS_UI, show_tabs_changed_cb, notebook); |