[gtk+] print: Add a .paper style class
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] print: Add a .paper style class
- Date: Sat, 4 Oct 2014 15:19:18 +0000 (UTC)
commit 82b7d21f6e24c81160e035899e1d95f5e4487ac3
Author: Benjamin Otte <otte redhat com>
Date: Fri Oct 3 16:19:34 2014 +0200
print: Add a .paper style class
... and use it in the print preview.
docs/reference/gtk/gtk3-sections.txt | 1 +
gtk/gtkprintunixdialog.c | 2 ++
gtk/gtkstylecontext.h | 11 +++++++++++
3 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index 9058cd7..de04e7f 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -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
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index 277b28a..fe62c2d 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -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;
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index 6184d84..b2a4c3e 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -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:
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]