print: Add a .paper style class

... and use it in the print preview.
This commit is contained in:
Benjamin Otte 2014-10-03 16:19:34 +02:00
parent f7d7d345da
commit 82b7d21f6e
3 changed files with 14 additions and 0 deletions

View File

@ -6013,6 +6013,7 @@ GTK_STYLE_CLASS_NOTEBOOK
GTK_STYLE_CLASS_OSD
GTK_STYLE_CLASS_OVERSHOOT
GTK_STYLE_CLASS_PANE_SEPARATOR
GTK_STYLE_CLASS_PAPER
GTK_STYLE_CLASS_POPUP
GTK_STYLE_CLASS_PRIMARY_TOOLBAR
GTK_STYLE_CLASS_PROGRESSBAR

View File

@ -2212,6 +2212,7 @@ paint_page (GtkWidget *widget,
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PAPER);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
gtk_render_background (context, cr, x, y, width, height);
@ -2750,6 +2751,7 @@ draw_page_cb (GtkWidget *widget,
context = gtk_widget_get_style_context (widget);
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PAPER);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
pos_x = (width - w) / 2;

View File

@ -873,6 +873,17 @@ struct _GtkStyleContextClass
*/
#define GTK_STYLE_CLASS_OVERSHOOT "overshoot"
/*
* GTK_STYLE_CLASS_PAPER:
* A CSS class that is added to areas that should look like paper.
*
* This is used in print previews and themes are encouraged to
* style it as black text on white background.
*
* Since: 3.16
*/
#define GTK_STYLE_CLASS_PAPER "paper"
/**
* GTK_STYLE_REGION_ROW:
*