[gnumeric] GnmNotebook: restore and port styling code from gtk2 to gtk3.



commit f79e3b205cef3fc93b915afb2dd1a2e0142197e8
Author: Morten Welinder <terra gnome org>
Date:   Thu Aug 11 14:23:37 2011 -0400

    GnmNotebook: restore and port styling code from gtk2 to gtk3.

 src/widgets/ChangeLog      |    5 +++++
 src/widgets/gnm-notebook.c |   18 ++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/widgets/ChangeLog b/src/widgets/ChangeLog
index 2bd127f..7fc3941 100644
--- a/src/widgets/ChangeLog
+++ b/src/widgets/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-11  Morten Welinder  <terra gnome org>
+
+	* gnm-notebook.c (gnm_notebook_init): Style GnmNotebook to avoid
+	padding line between tabs and (empty) pages.
+
 2011-08-07  Jean Brefort  <jean brefort normalesup org>
 
 	* widget-editable-label.c (el_set_style_entry),
diff --git a/src/widgets/gnm-notebook.c b/src/widgets/gnm-notebook.c
index bcee6d8..b4f1e36 100644
--- a/src/widgets/gnm-notebook.c
+++ b/src/widgets/gnm-notebook.c
@@ -79,7 +79,25 @@ gnm_notebook_class_init (GtkWidgetClass *klass)
 static void
 gnm_notebook_init (GnmNotebook *notebook)
 {
+	GtkCssProvider *css;
+	GtkStyleContext *context;
+
 	gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE);
+
+	context = gtk_widget_get_style_context (GTK_WIDGET (notebook));
+	css = gtk_css_provider_new ();
+	gtk_css_provider_load_from_data (css,
+					 "GnmNotebook {\n"
+					 "  padding: 0;\n"
+					 "/*  background-color: #dd0000; */\n"
+					 "}\n"
+					 "GnmNotebook tab {\n"
+					 "}",
+					 -1, NULL);
+	gtk_style_context_add_provider (context,
+					GTK_STYLE_PROVIDER (css),
+					GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+	g_object_unref (css);
 }
 
 GSF_CLASS (GnmNotebook, gnm_notebook,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]