Skip to content

Commit 027a658

Browse files
Carlos Garcia Camposraveit65
authored andcommitted
view: Fix page background rendering while loading
origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-8&id=38528f9
1 parent df069ae commit 027a658

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

libview/ev-view.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ typedef struct {
105105
#define SCROLL_TIME 150
106106

107107
#define EV_STYLE_CLASS_DOCUMENT_PAGE "document-page"
108+
#define EV_STYLE_CLASS_INVERTED "inverted"
108109

109110
/*** Scrolling ***/
110111
static void view_update_range_and_current_page (EvView *view);
@@ -5801,10 +5802,13 @@ draw_one_page (EvView *view,
58015802

58025803
gtk_style_context_save (context);
58035804
gtk_style_context_add_class (context, EV_STYLE_CLASS_DOCUMENT_PAGE);
5805+
if (ev_document_model_get_inverted_colors (view->model))
5806+
gtk_style_context_add_class (context, EV_STYLE_CLASS_INVERTED);
58045807

58055808
if (view->continuous && page == current_page)
58065809
gtk_style_context_set_state (context, GTK_STATE_FLAG_ACTIVE);
58075810

5811+
gtk_render_background (context, cr, page_area->x, page_area->y, page_area->width, page_area->height);
58085812
gtk_render_frame (context, cr, page_area->x, page_area->y, page_area->width, page_area->height);
58095813
gtk_style_context_restore (context);
58105814

shell/atril.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
}
1111

1212
evview.document-page {
13+
background-color: white;
1314
border-color: black;
1415
border-style: solid;
1516
border-width: 1px;
@@ -19,6 +20,7 @@ evview.document-page {
1920
}
2021

2122
evview.document-page:active {
23+
background-color: white;
2224
border-color: @theme_selected_bg_color;
2325
border-style: solid;
2426
border-width: 1px;
@@ -27,6 +29,10 @@ evview.document-page:active {
2729
padding: 0;
2830
}
2931

32+
evview.document-page.inverted {
33+
background-color: black;
34+
}
35+
3036
evpresentationview {
3137
background-color: black;
3238
}

0 commit comments

Comments
 (0)