[goffice] gui: install goffice.css for all widgets.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] gui: install goffice.css for all widgets.
- Date: Wed, 6 Dec 2017 01:27:50 +0000 (UTC)
commit 68684d5d96a111c520f27af37e70c9d023009dc1
Author: Morten Welinder <terra gnome org>
Date: Tue Dec 5 20:27:08 2017 -0500
gui: install goffice.css for all widgets.
ChangeLog | 5 +++++
goffice/gtk/goffice-gtk.c | 25 ++++++++++++++++++++-----
goffice/gtk/goffice.css | 14 ++++++++++++++
3 files changed, 39 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f3eb887..6bcff9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-12-05 Morten Welinder <terra gnome org>
+
+ * goffice/gtk/goffice-gtk.c (_go_gtk_widget_add_css_provider):
+ Install the css provider screen-wide.
+
2017-12-02 Morten Welinder <terra gnome org>
* goffice/gtk/go-rotation-sel.c (cb_rotate_canvas_realize): Use
diff --git a/goffice/gtk/goffice-gtk.c b/goffice/gtk/goffice-gtk.c
index 91ce5b1..8c3641b 100644
--- a/goffice/gtk/goffice-gtk.c
+++ b/goffice/gtk/goffice-gtk.c
@@ -1635,6 +1635,21 @@ go_gtk_widget_render_icon_pixbuf (GtkWidget *widget,
}
static GtkCssProvider *css_provider;
+static GSList *css_provider_screens;
+
+static void
+cb_screen_changed (GtkWidget *widget)
+{
+ GdkScreen *screen = gtk_widget_get_screen (widget);
+
+ if (!screen || g_slist_find (css_provider_screens, screen))
+ return;
+
+ css_provider_screens = g_slist_prepend (css_provider_screens, screen);
+ gtk_style_context_add_provider_for_screen (screen, css_provider,
+ GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
+}
+
void
_go_gtk_widget_add_css_provider (GtkWidget *w)
@@ -1647,15 +1662,15 @@ _go_gtk_widget_add_css_provider (GtkWidget *w)
gtk_css_provider_load_from_data (css_provider, data, -1, NULL);
}
- // NOTE: This applies to *just* this widget.
- gtk_style_context_add_provider
- (gtk_widget_get_style_context (w),
- GTK_STYLE_PROVIDER (css_provider),
- GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
+ g_signal_connect (w, "screen-changed",
+ G_CALLBACK (cb_screen_changed), NULL);
+ cb_screen_changed (w);
}
void
_go_gtk_shutdown (void)
{
g_clear_object (&css_provider);
+ g_slist_free (css_provider_screens);
+ css_provider_screens = NULL;
}
diff --git a/goffice/gtk/goffice.css b/goffice/gtk/goffice.css
index f5be9b2..95da1d5 100644
--- a/goffice/gtk/goffice.css
+++ b/goffice/gtk/goffice.css
@@ -6,6 +6,7 @@
*/
/* ------------------------------------------------------------------------- */
+/* Gtk 3.19 and earlier: */
GORotationSel GocCanvas {
background-image: none;
@@ -16,3 +17,16 @@ GO3DRotationSel GocCanvas {
background-image: none;
background-color: white;
}
+
+/* ------------------------------------------------------------------------- */
+/* Gtk 3.20 and later: */
+
+rotationselector canvas {
+ background-image: none;
+ background-color: white;
+}
+
+rotation3dselector canvas {
+ background-image: none;
+ background-color: white;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]