[epiphany/wip/exalm/tab-position] Remove tabs-bar-position setting
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/exalm/tab-position] Remove tabs-bar-position setting
- Date: Thu, 28 Jan 2021 15:32:59 +0000 (UTC)
commit b820125b0923127724f3348fbb9823918be1d48d
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Thu Jan 28 19:50:22 2021 +0500
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.
data/org.gnome.epiphany.gschema.xml | 5 ---
lib/ephy-prefs.h | 9 -----
src/ephy-notebook.c | 67 -------------------------------------
3 files changed, 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
@@ -23,14 +23,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,
@@ -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;
@@ -586,9 +525,6 @@ ephy_notebook_init (EphyNotebook *notebook)
g_signal_connect (EPHY_SETTINGS_UI,
"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);
@@ -639,9 +575,6 @@ ephy_notebook_finalize (GObject *object)
g_signal_handlers_disconnect_by_func (EPHY_SETTINGS_UI,
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]