Skip to content

Commit

Permalink
view: Fix page background rendering while loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Garcia Campos authored and raveit65 committed Apr 5, 2018
1 parent 3349fb9 commit e5c8ce7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libview/ev-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ typedef struct {
#define SCROLL_TIME 150

#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);
Expand Down Expand Up @@ -5801,10 +5802,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);

Expand Down
6 changes: 6 additions & 0 deletions shell/atril.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
}

evview.document-page {
background-color: white;
border-color: black;
border-style: solid;
border-width: 1px;
Expand All @@ -19,6 +20,7 @@ evview.document-page {
}

evview.document-page:active {
background-color: white;
border-color: @theme_selected_bg_color;
border-style: solid;
border-width: 1px;
Expand All @@ -27,6 +29,10 @@ evview.document-page:active {
padding: 0;
}

evview.document-page.inverted {
background-color: black;
}

evpresentationview {
background-color: black;
}
Expand Down

0 comments on commit e5c8ce7

Please sign in to comment.