From 885ce428a981d7248d5f5088627164fdea8f391c Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 14 Mar 2008 10:08:58 +0000 Subject: Ensure that scrollbar foreground is actually visible (black on black, for example, isn't very usable) svn path=/trunk/netsurf/; revision=3950 --- render/html_redraw.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/render/html_redraw.c b/render/html_redraw.c index f3017f0f7..8c66a1035 100644 --- a/render/html_redraw.c +++ b/render/html_redraw.c @@ -1478,8 +1478,16 @@ bool html_redraw_scrollbars(struct box *box, float scale, bool vscroll, hscroll; int well_height, bar_top, bar_height; int well_width, bar_left, bar_width; - const colour vcolour = box->style->border[RIGHT].color; - const colour hcolour = box->style->border[BOTTOM].color; + colour vcolour = box->style->border[RIGHT].color; + colour hcolour = box->style->border[BOTTOM].color; + + /** \todo We probably want to clamp to either end of the spectrum, + * rather than simply taking the inverse colour. */ + if (vcolour == TRANSPARENT || vcolour == background_colour) + vcolour = background_colour ^ 0xffffff; + + if (hcolour == TRANSPARENT || hcolour == background_colour) + hcolour = background_colour ^ 0xffffff; box_scrollbar_dimensions(box, padding_width, padding_height, w, &vscroll, &hscroll, -- cgit v1.2.3