[gnumeric] GUI: Work around gtk+ 3.2 css issue #696586.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] GUI: Work around gtk+ 3.2 css issue #696586.
- Date: Mon, 25 Mar 2013 22:30:01 +0000 (UTC)
commit 8aa727f2e45829b4986b837283db859b73cde547
Author: Morten Welinder <terra gnome org>
Date: Mon Mar 25 18:29:05 2013 -0400
GUI: Work around gtk+ 3.2 css issue #696586.
ChangeLog | 6 ++++++
src/gnumeric.css | 9 +++++----
src/wbc-gtk.c | 21 ++++++++++++++++++++-
3 files changed, 31 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a23883d..871d69c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2013-03-25 Morten Welinder <terra gnome org>
+ * src/gnumeric.css: use deprecated px-free syntax for padding, so
+ gtk+ 3.2 can deal with it.
+
+ * src/wbc-gtk.c (cb_screen_changed): Install error handler so we
+ can suppress deprecations.
+
* src/sheet-control-gui.c (cb_select_all_btn_draw): Fix drawing of
the "all" button.
diff --git a/src/gnumeric.css b/src/gnumeric.css
index 5e1377d..a3f4ac6 100644
--- a/src/gnumeric.css
+++ b/src/gnumeric.css
@@ -31,6 +31,7 @@ GnmPane {
CommentView {
color: red;
+ /* See also GnmPane */
}
/* ------------------------------------------------------------------------- */
@@ -38,10 +39,10 @@ CommentView {
/* These are also styled with class button */
ItemBar {
- padding-left: 5px;
- padding-right: 5px;
- padding-top: 2px;
- padding-bottom: 2px;
+ padding-left: 5/*px*/; /* From gtk3.4 always use "px" */
+ padding-right: 5/*px*/;
+ padding-top: 2/*px*/;
+ padding-bottom: 2/*px*/;
}
/* The whole column/row selected. */
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index f984e8e..23d8fd1 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -2301,6 +2301,17 @@ cb_realize (GtkWindow *toplevel, WBCGtk *wbcg)
}
static void
+cb_css_parse_error (GtkCssProvider *css, GtkCssSection *section, GError *err)
+{
+ if (g_error_matches (err, GTK_CSS_PROVIDER_ERROR,
+ GTK_CSS_PROVIDER_ERROR_DEPRECATED) &&
+ !gnm_debug_flag ("css"))
+ return;
+
+ g_warning ("Theme parsing error: %s", err->message);
+}
+
+static void
cb_screen_changed (GtkWidget *widget)
{
GdkScreen *screen = gtk_widget_get_screen (widget);
@@ -2308,7 +2319,15 @@ cb_screen_changed (GtkWidget *widget)
if (screen && !g_object_get_data (G_OBJECT (screen), key)) {
GtkCssProvider *css = gtk_css_provider_new ();
- const char *csstext = go_rsm_lookup ("gnm:gnumeric.css", NULL);
+ const char *resource = "gnm:gnumeric.css";
+ const char *csstext = go_rsm_lookup (resource, NULL);
+
+ if (gnm_debug_flag ("css"))
+ g_printerr ("Loading style from %s\n", resource);
+
+ g_signal_connect (css, "parsing-error",
+ G_CALLBACK (cb_css_parse_error),
+ NULL);
gtk_css_provider_load_from_data (css, csstext, -1, NULL);
gtk_style_context_add_provider_for_screen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]