[evince] view: Fix page background rendering while loading



commit 38528f9f1e225f4d661a1d813c5fae45fd6707d4
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sun Dec 23 11:28:46 2012 +0100

    view: Fix page background rendering while loading

 libview/ev-view.c |    4 ++++
 shell/evince.css  |    6 ++++++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index a7d0c47..df11e5d 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -105,6 +105,7 @@ typedef struct {
 #define DEFAULT_PIXBUF_CACHE_SIZE 52428800 /* 50MB */
 
 #define EV_STYLE_CLASS_DOCUMENT_PAGE "document-page"
+#define EV_STYLE_CLASS_INVERTED      "inverted"
 
 /*** Scrolling ***/
 static void       view_update_range_and_current_page         (EvView             *view);
@@ -4380,10 +4381,13 @@ draw_one_page (EvView       *view,
 
 	gtk_style_context_save (context);
 	gtk_style_context_add_class (context, EV_STYLE_CLASS_DOCUMENT_PAGE);
+	if (ev_document_model_get_inverted_colors (view->model))
+		gtk_style_context_add_class (context, EV_STYLE_CLASS_INVERTED);
 
 	if (view->continuous && page == current_page)
 		gtk_style_context_set_state (context, GTK_STATE_FLAG_ACTIVE);
 
+	gtk_render_background (context, cr, page_area->x, page_area->y, page_area->width, page_area->height);
 	gtk_render_frame (context, cr, page_area->x, page_area->y, page_area->width, page_area->height);
 	gtk_style_context_restore (context);
 
diff --git a/shell/evince.css b/shell/evince.css
index 956f491..6fd2ecc 100644
--- a/shell/evince.css
+++ b/shell/evince.css
@@ -18,6 +18,7 @@ EvView:selected {
 }
 
 EvView.document-page {
+    background-color: white;
     border-color: black;
     border-style: solid;
     border-width: 1px;
@@ -27,6 +28,7 @@ EvView.document-page {
 }
 
 EvView.document-page:active {
+    background-color: white;
     border-color: @theme_selected_bg_color;
     border-style: solid;
     border-width: 1px;
@@ -34,3 +36,7 @@ EvView.document-page:active {
     border-image: none;
     padding: 0;
 }
+
+EvView.document-page.inverted {
+    background-color: black;
+}



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