[evince] Invert colors of pages when loading in inverted color mode



commit 5f13b35d7289f486f4022094f8574608d11c9d73
Author: Juanjo Marín <juanj marin juntadeandalucia es>
Date:   Tue May 4 11:10:12 2010 +0200

    Invert colors of pages when loading in inverted color mode
    
    Fixes bug #616110.

 libdocument/ev-document-misc.c |    5 +++--
 libdocument/ev-document-misc.h |    3 ++-
 libview/ev-view.c              |    5 ++++-
 3 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c
index 7f2f731..4d8bc28 100644
--- a/libdocument/ev-document-misc.c
+++ b/libdocument/ev-document-misc.c
@@ -118,7 +118,8 @@ ev_document_misc_paint_one_page (GdkDrawable  *drawable,
 				 GtkWidget    *widget,
 				 GdkRectangle *area,
 				 GtkBorder    *border,
-				 gboolean highlight)
+				 gboolean      highlight,
+				 gboolean      inverted_colors)
 {
 	GtkStyle    *style = gtk_widget_get_style (widget);
 	GtkStateType state = gtk_widget_get_state (widget);
@@ -131,7 +132,7 @@ ev_document_misc_paint_one_page (GdkDrawable  *drawable,
 			    area->width,
 			    area->height);
 	gdk_draw_rectangle (drawable,
-			    style->white_gc,
+			    inverted_colors ? style->black_gc : style->white_gc,
 			    TRUE,
 			    area->x + border->left,
 			    area->y + border->top,
diff --git a/libdocument/ev-document-misc.h b/libdocument/ev-document-misc.h
index e392076..2503aa7 100644
--- a/libdocument/ev-document-misc.h
+++ b/libdocument/ev-document-misc.h
@@ -43,7 +43,8 @@ void       ev_document_misc_paint_one_page       (GdkDrawable  *drawable,
 						  GtkWidget    *widget,
 						  GdkRectangle *area,
 						  GtkBorder    *border,
-						  gboolean      highlight);
+						  gboolean      highlight,
+						  gboolean      inverted_colors);
 
 cairo_surface_t *ev_document_misc_surface_from_pixbuf (GdkPixbuf *pixbuf);
 GdkPixbuf       *ev_document_misc_pixbuf_from_surface (cairo_surface_t *surface);
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 244f19b..8f9d99a 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -3988,6 +3988,7 @@ draw_one_page (EvView       *view,
 	GdkRectangle overlap;
 	GdkRectangle real_page_area;
 	gint         current_page;
+	gboolean     inverted_colors;
 
 	g_assert (view->document);
 
@@ -4004,10 +4005,12 @@ draw_one_page (EvView       *view,
 	*page_ready = TRUE;
 
 	current_page = ev_document_model_get_page (view->model);
+	inverted_colors = ev_document_model_get_inverted_colors (view->model);
 	ev_document_misc_paint_one_page (view->layout.bin_window,
 					 GTK_WIDGET (view),
 					 page_area, border,
-					 page == current_page);
+					 page == current_page,
+					 inverted_colors);
 
 	if (gdk_rectangle_intersect (&real_page_area, expose_area, &overlap)) {
 		gint             width, height;



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