[Xfce4-commits] [apps/xfce4-terminal] 01/01: Add hidden option MiscSlimTabs to override huge gtk3 tabs style
noreply at xfce.org
noreply at xfce.org
Wed Dec 21 13:13:39 CET 2016
This is an automated email from the git hooks/post-receive script.
f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.
commit 763bd8fce3ab3c2bf039852eed507529423d54e0
Author: Igor <f2404 at yandex.ru>
Date: Wed Dec 21 15:13:31 2016 +0300
Add hidden option MiscSlimTabs to override huge gtk3 tabs style
---
terminal/terminal-preferences.c | 11 ++++++++++
terminal/terminal-window.c | 46 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 57 insertions(+)
diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index 99ff5ae..851301a 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -102,6 +102,7 @@ enum
PROP_MISC_DEFAULT_WORKING_DIR,
PROP_MISC_REWRAP_ON_RESIZE,
PROP_MISC_SHIFT_ARROWS_SCROLL,
+ PROP_MISC_SLIM_TABS,
PROP_SCROLLING_BAR,
PROP_SCROLLING_LINES,
PROP_SCROLLING_ON_OUTPUT,
@@ -935,6 +936,16 @@ terminal_preferences_class_init (TerminalPreferencesClass *klass)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
+ * TerminalPreferences:misc-shift-arrows-scroll:
+ **/
+ preferences_props[PROP_MISC_SLIM_TABS] =
+ g_param_spec_boolean ("misc-slim-tabs",
+ NULL,
+ "MiscSlimTabs",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+
+ /**
* TerminalPreferences:scrolling-bar:
**/
preferences_props[PROP_SCROLLING_BAR] =
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 92299ef..79350f6 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -70,6 +70,26 @@ enum
LAST_SIGNAL
};
+/* CSS for slim notebook tabs style */
+const gchar *CSS_SLIM_TABS =
+"notebook tab {\n"
+" min-height: 0;\n"
+" padding-top: 2px;\n"
+" padding-bottom: 2px;\n"
+"}\n"
+"notebook tab button {\n"
+" min-height: 0;\n"
+" min-width: 0;\n"
+" padding: 2px;\n"
+" margin-top: 2px;\n"
+" margin-bottom: 2px;\n"
+"}\n"
+"notebook button {\n"
+" min-height: 0;\n"
+" min-width: 0;\n"
+" padding: 2px;\n"
+"}\n";
+
static void terminal_window_finalize (GObject *object);
@@ -96,6 +116,7 @@ static gboolean terminal_window_accel_activate (GtkAccelGroup
GdkModifierType accel_mods,
TerminalWindow *window);
static void terminal_window_update_actions (TerminalWindow *window);
+static void terminal_window_update_slim_tabs (TerminalWindow *window);
static void terminal_window_notebook_page_switched (GtkNotebook *notebook,
GtkWidget *page,
guint page_num,
@@ -449,6 +470,8 @@ terminal_window_init (TerminalWindow *window)
/* set the notebook group id */
gtk_notebook_set_group_name (GTK_NOTEBOOK (window->priv->notebook), window_notebook_group);
+ terminal_window_update_slim_tabs (window);
+
/* signals */
g_signal_connect (G_OBJECT (window->priv->notebook), "switch-page",
G_CALLBACK (terminal_window_notebook_page_switched), window);
@@ -881,6 +904,29 @@ terminal_window_update_actions (TerminalWindow *window)
static void
+terminal_window_update_slim_tabs (TerminalWindow *window)
+{
+ GdkScreen *screen = gtk_window_get_screen (GTK_WINDOW (window));
+ GtkCssProvider *provider;
+ gboolean slim_tabs;
+
+ g_object_get (G_OBJECT (window->priv->preferences),
+ "misc-slim-tabs", &slim_tabs,
+ NULL);
+ if (slim_tabs)
+ {
+ provider = gtk_css_provider_new ();
+ gtk_style_context_add_provider_for_screen (screen,
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ gtk_css_provider_load_from_data (provider, CSS_SLIM_TABS, -1, NULL);
+ g_object_unref (provider);
+ }
+}
+
+
+
+static void
terminal_window_notebook_page_switched (GtkNotebook *notebook,
GtkWidget *page,
guint page_num,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list