[gnome-font-viewer] font-view: make sure rendered text is black on white



commit 0986558a63234d266e4dc47385f4cc50c88398a8
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue May 1 11:15:52 2012 -0400

    font-view: make sure rendered text is black on white
    
    Also, don't use deprecated GTK API to set this.

 src/font-view.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/font-view.c b/src/font-view.c
index 593b9ae..d0e2fc9 100644
--- a/src/font-view.c
+++ b/src/font-view.c
@@ -422,7 +422,8 @@ font_view_application_do_open (FontViewApplication *self)
 {
     gchar *uri;
     GtkWidget *font_widget;
-    GdkColor white = { 0, 0xffff, 0xffff, 0xffff };
+    GdkRGBA white = { 1.0, 1.0, 1.0, 1.0 };
+    GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 };
     GtkWidget *w;
 
     w = gtk_bin_get_child (GTK_BIN (self->swin_preview));
@@ -454,7 +455,8 @@ font_view_application_do_open (FontViewApplication *self)
     uri = g_file_get_uri (self->font_file);
     self->font_widget = font_widget = GTK_WIDGET (sushi_font_widget_new (uri));
 
-    gtk_widget_modify_bg (font_widget, GTK_STATE_NORMAL, &white);
+    gtk_widget_override_color (font_widget, GTK_STATE_NORMAL, &black);
+    gtk_widget_override_background_color (font_widget, GTK_STATE_FLAG_NORMAL, &white);
     g_free (uri);
 
     w = gtk_viewport_new (NULL, NULL);



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