From a8cc3156edb422eada7d7fd31467424835c5c809 Mon Sep 17 00:00:00 2001 From: ZenWalker Date: Sat, 2 Sep 2017 02:05:31 +0200 Subject: add gsettings key to hide/show(default) tabs with the side pane --- data/org.mate.pluma.gschema.xml.in | 5 +++++ pluma/pluma-notebook.c | 19 ++++++++++++++----- pluma/pluma-window.c | 8 ++++++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/data/org.mate.pluma.gschema.xml.in b/data/org.mate.pluma.gschema.xml.in index 8f97fdbe..75fe7d11 100644 --- a/data/org.mate.pluma.gschema.xml.in +++ b/data/org.mate.pluma.gschema.xml.in @@ -196,5 +196,10 @@ Active plugins List of active plugins. It contains the "Location" of the active plugins. See the .pluma-plugin file for obtaining the "Location" of a given plugin. + + true + Show tabs with side pane + If false, pluma doesn't show tabs in the notebook with the side pane active. + diff --git a/pluma/pluma-notebook.c b/pluma/pluma-notebook.c index 8afce33c..7fc7485a 100644 --- a/pluma/pluma-notebook.c +++ b/pluma/pluma-notebook.c @@ -48,6 +48,7 @@ #include "pluma-tab-label.h" #include "pluma-marshal.h" #include "pluma-window.h" +#include "pluma-prefs-manager.h" #define AFTER_ALL_TABS -1 #define NOT_IN_APP_WINDOWS -2 @@ -721,8 +722,9 @@ static void update_tabs_visibility (PlumaNotebook *nb, gboolean before_inserting) { - gboolean show_tabs; - guint num; + gboolean show_tabs; + guint num; + GSettings *settings; num = gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb)); @@ -730,10 +732,17 @@ update_tabs_visibility (PlumaNotebook *nb, show_tabs = (nb->priv->always_show_tabs || num > 1); - if (pluma_prefs_manager_get_side_pane_visible ()) - gtk_notebook_set_show_tabs (GTK_NOTEBOOK (nb), FALSE); - else + settings = g_settings_new ("org.mate.pluma"); + + if (g_settings_get_boolean (settings, "show-tabs-with-side-pane")) gtk_notebook_set_show_tabs (GTK_NOTEBOOK (nb), show_tabs); + else + { + if (pluma_prefs_manager_get_side_pane_visible ()) + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (nb), FALSE); + else + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (nb), show_tabs); + } } static void diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c index 666e2c5d..5e9f8d94 100644 --- a/pluma/pluma-window.c +++ b/pluma/pluma-window.c @@ -3573,12 +3573,16 @@ static void side_panel_visibility_changed (GtkWidget *side_panel, PlumaWindow *window) { - gboolean visible; + gboolean visible; GtkAction *action; + GSettings *settings; visible = gtk_widget_get_visible (side_panel); - gtk_notebook_set_show_tabs (GTK_NOTEBOOK (window->priv->notebook), !visible); + settings = g_settings_new ("org.mate.pluma"); + + if (!g_settings_get_boolean (settings, "show-tabs-with-side-pane")) + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (window->priv->notebook), !visible); if (pluma_prefs_manager_side_pane_visible_can_set ()) pluma_prefs_manager_set_side_pane_visible (visible); -- cgit v1.2.1