[gnumeric] GUI: Kill css warning on pre-GTK 3.4.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] GUI: Kill css warning on pre-GTK 3.4.
- Date: Fri, 5 Apr 2013 13:52:26 +0000 (UTC)
commit e11d588a2889a7f31413042f040bde95db61ca85
Author: Morten Welinder <terra gnome org>
Date: Fri Apr 5 09:52:01 2013 -0400
GUI: Kill css warning on pre-GTK 3.4.
ChangeLog | 2 +-
src/gnumeric.css | 3 ++-
src/wbc-gtk.c | 13 +++++++++++++
3 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b156238..3017058 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
2013-04-05 Morten Welinder <terra gnome org>
* src/wbc-gtk.c (cb_screen_changed): Re-use the css provider for
- new screens.
+ new screens. Add hack for pre-GTK 3.4.
* src/mathfunc.c (gnm_owent): New function.
diff --git a/src/gnumeric.css b/src/gnumeric.css
index 8172b2c..393338f 100644
--- a/src/gnumeric.css
+++ b/src/gnumeric.css
@@ -166,7 +166,8 @@ GtkWindow *.pseudo-tooltip {
}
GtkTextView.pseudo-tooltip {
- color: inherit;
+ /* Code in wbc-gtk.c:cb_screen_changed will kill the following line pre-GTK 3.4 */
+/*MAGIC*/ color: inherit;
}
/* ------------------------------------------------------------------------- */
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index b5621db..85e1e74 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -2309,6 +2309,16 @@ cb_screen_changed (GtkWidget *widget)
const char *resource = "gnm:gnumeric.css";
const char *csstext = go_rsm_lookup (resource, NULL);
gboolean debug = gnm_debug_flag ("css");
+#if !GTK_CHECK_VERSION(3,4,0)
+ char *csstext_copy = g_strdup (csstext);
+ csstext = csstext_copy;
+ while (1) {
+ char *magic = strstr (csstext_copy, "/*MAGIC*/");
+ if (!magic)
+ break;
+ memset (magic, ' ', strchr (magic, '\n') - magic);
+ }
+#endif
css = gtk_css_provider_new ();
@@ -2321,6 +2331,9 @@ cb_screen_changed (GtkWidget *widget)
gtk_css_provider_load_from_data (css, csstext, -1, NULL);
g_object_set_data_full (app, app_key, css, g_object_unref);
+#if !GTK_CHECK_VERSION(3,4,0)
+ g_free (csstext_copy);
+#endif
}
if (screen && !g_object_get_data (G_OBJECT (screen), key)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]