From 21e9431b8cf60db9ab2f9cf846e2f34ba07979f3 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Mon, 7 Aug 2017 17:04:15 +0200 Subject: 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 --- libdocument/ev-document-misc.c | 41 +++++++++++++++++------------------------ 1 file 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 * -- cgit v1.2.1