diff options
author | raveit65 <[email protected]> | 2017-08-07 17:04:15 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-08-11 13:58:24 +0200 |
commit | 21e9431b8cf60db9ab2f9cf846e2f34ba07979f3 (patch) | |
tree | 7ab5d99da93395e0ad098ae9abc330d166a1e641 /libdocument/ev-document-misc.c | |
parent | 88e0ce4e947fab89e2dba5137f084efb6e0b7c9a (diff) | |
download | atril-21e9431b8cf60db9ab2f9cf846e2f34ba07979f3.tar.bz2 atril-21e9431b8cf60db9ab2f9cf846e2f34ba07979f3.tar.xz |
libdocument: adjust rendering of shadow for active and inactive pages
and fix usage of deprecated gtk_symbolic_color
https://github.com/linuxmint/xreader/commit/c171041
https://github.com/linuxmint/xreader/commit/68f365a
Diffstat (limited to 'libdocument/ev-document-misc.c')
-rw-r--r-- | libdocument/ev-document-misc.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c index 1afa1d77..d4f16482 100644 --- a/libdocument/ev-document-misc.c +++ b/libdocument/ev-document-misc.c @@ -143,20 +143,28 @@ ev_document_misc_paint_one_page (cairo_t *cr, GtkStyleContext *context = gtk_widget_get_style_context (widget); GtkStateFlags state = gtk_widget_get_state_flags (widget); GdkRGBA fg, bg, shade_bg; - GtkSymbolicColor *c1, *c2; gtk_style_context_get_background_color (context, state, &bg); gtk_style_context_get_color (context, state, &fg); - - // FIXME: should we cache the shade_bg? - c1 = gtk_symbolic_color_new_literal (&bg); - c2 = gtk_symbolic_color_new_shade (c1, 0.7); - gtk_symbolic_color_resolve (c2, NULL, &shade_bg); - gtk_symbolic_color_unref (c1); - gtk_symbolic_color_unref (c2); + gtk_style_context_get_color (context, state, &shade_bg); + shade_bg.alpha *= 0.5; gdk_cairo_set_source_rgba (cr, highlight ? &fg : &shade_bg); - gdk_cairo_rectangle (cr, area); + cairo_rectangle (cr, + area->x, + area->y, + area->width - border->right + border->left, + area->height - border->bottom + border->top); + cairo_rectangle (cr, + area->x + area->width - border->right, + area->y + border->right - border->left, + border->right, + area->height - border->right + border->left); + cairo_rectangle (cr, + area->x + border->bottom - border->top, + area->y + area->height - border->bottom, + area->width - border->bottom + border->top, + border->bottom); cairo_fill (cr); if (inverted_colors) @@ -169,21 +177,6 @@ ev_document_misc_paint_one_page (cairo_t *cr, area->width - (border->left + border->right), area->height - (border->top + border->bottom)); cairo_fill (cr); - - gdk_cairo_set_source_rgba (cr, &bg); - cairo_rectangle (cr, - area->x, - area->y + area->height - (border->bottom - border->top), - border->bottom - border->top, - border->bottom - border->top); - cairo_fill (cr); - - cairo_rectangle (cr, - area->x + area->width - (border->right - border->left), - area->y, - border->right - border->left, - border->right - border->left); - cairo_fill (cr); } cairo_surface_t * |