[goffice] css: split css for old and new gtk+ versions into different files.



commit 98697c4bf8902bf69e58e33d8894bbd5d3047961
Author: Morten Welinder <terra gnome org>
Date:   Thu Dec 7 20:26:34 2017 -0500

    css: split css for old and new gtk+ versions into different files.
    
    *sigh*

 goffice/Makefile.am         |    1 +
 goffice/gtk/goffice-gtk.c   |    4 +++-
 goffice/gtk/goffice-old.css |   12 ++++++++++++
 goffice/gtk/goffice.css     |   22 +---------------------
 4 files changed, 17 insertions(+), 22 deletions(-)
---
diff --git a/goffice/Makefile.am b/goffice/Makefile.am
index bcff801..bb69491 100644
--- a/goffice/Makefile.am
+++ b/goffice/Makefile.am
@@ -616,6 +616,7 @@ embedded_stuff_compress = \
        utils/go-style-prefs.ui
 
 embedded_stuff_raw = \
+       gtk/goffice-old.css                     \
        gtk/goffice.css                         \
        utils/svg-patterns.xml                  \
        utils/unknown_image.png                 \
diff --git a/goffice/gtk/goffice-gtk.c b/goffice/gtk/goffice-gtk.c
index 3a69647..7866aac 100644
--- a/goffice/gtk/goffice-gtk.c
+++ b/goffice/gtk/goffice-gtk.c
@@ -1659,7 +1659,9 @@ _go_gtk_widget_add_css_provider (GtkWidget *w)
        g_return_if_fail (GTK_IS_WIDGET (w));
 
        if (!css_provider) {
-               const char *data = go_rsm_lookup ("go:gtk/goffice.css", NULL);
+               const char *data = _go_gtk_new_theming ()
+                       ? go_rsm_lookup ("go:gtk/goffice.css", NULL)
+                       : go_rsm_lookup ("go:gtk/goffice-old.css", NULL);
                css_provider = gtk_css_provider_new ();
                gtk_css_provider_load_from_data (css_provider, data, -1, NULL);
        }
diff --git a/goffice/gtk/goffice-old.css b/goffice/gtk/goffice-old.css
new file mode 100644
index 0000000..540f9a2
--- /dev/null
+++ b/goffice/gtk/goffice-old.css
@@ -0,0 +1,12 @@
+/* css bindings for goffice.  This is loaded for gtk+ 3.19 or earlier.  */
+/* ------------------------------------------------------------------------- */
+
+GORotationSel GocCanvas {
+  background-image: none;
+  background-color: white;
+}
+
+GO3DRotationSel GocCanvas {
+  background-image: none;
+  background-color: white;
+}
diff --git a/goffice/gtk/goffice.css b/goffice/gtk/goffice.css
index fcfbd22..24f954e 100644
--- a/goffice/gtk/goffice.css
+++ b/goffice/gtk/goffice.css
@@ -1,25 +1,5 @@
-/*
- * css bindings for goffice.
- *
- * These are loaded with "fallback" priority, i.e., everything else will
- * override them.
- */
-
-/* ------------------------------------------------------------------------- */
-/* Gtk 3.19 and earlier: */
-
-GORotationSel GocCanvas {
-  background-image: none;
-  background-color: white;
-}
-
-GO3DRotationSel GocCanvas {
-  background-image: none;
-  background-color: white;
-}
-
+/* css bindings for goffice.  This is loaded for gtk+ 3.20 and later.  */
 /* ------------------------------------------------------------------------- */
-/* Gtk 3.20 and later: */
 
 rotationselector canvas {
   background-image: none;


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