X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-output-view.c;h=0a2b4c797072a13f583bd67e0c30c83b7dbe0fb3;hb=a693f5d9963866bdc7ae3e19a0f9d51b478d48f8;hp=cfa385e22d8475258bb78c43fbff76aa9b5c5ddd;hpb=9715238957b4a5b43d12edb9ed03f79e31ee5648;p=pspp diff --git a/src/ui/gui/psppire-output-view.c b/src/ui/gui/psppire-output-view.c index cfa385e22d..0a2b4c7970 100644 --- a/src/ui/gui/psppire-output-view.c +++ b/src/ui/gui/psppire-output-view.c @@ -83,6 +83,24 @@ enum N_COLS }; +/* Draws a white background on the GtkLayout to match the white background of + each of the output items. */ +static gboolean +layout_draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data) +{ + cairo_save (cr); + + int width = gtk_widget_get_allocated_width (widget); + int height = gtk_widget_get_allocated_height (widget); + cairo_rectangle (cr, 0, 0, width, height); + cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); + cairo_fill (cr); + + cairo_restore (cr); + + return FALSE; /* Continue drawing the GtkDrawingAreas. */ +} + static gboolean draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data) { @@ -691,6 +709,8 @@ psppire_output_view_new (GtkLayout *output, GtkTreeView *overview) view->print_n_pages = 0; view->paginated = FALSE; + g_signal_connect (output, "draw", G_CALLBACK (layout_draw_callback), NULL); + g_signal_connect (output, "style-updated", G_CALLBACK (on_style_updated), view); g_signal_connect (output, "size-allocate", G_CALLBACK (on_size_allocate), view);