FIX: plastik style poor color choices for tree views

Matthew Woehlke mw_triad at users.sourceforge.net
Mon Feb 5 15:15:55 GMT 2007


Matthew Woehlke wrote:
> In certain color schemes (particularly dark window background color), 
> the Plastik style makes poor color choices that can make the lines in 
> tree views, and the boxes around the expand icons, nearly invisible.
> 
> The attached patch fixes this. Ok to commit? Or would someone like to 
> suggest an alternative fix? (Also I'm fine with second opinions on the 
> alphaBlend factors; I more-or-less pulled these out of the air.)
> 
> (At least Phase also has this problem, see 
> http://bugs.kde.org/show_bug.cgi?id=137055)

Well, I guess if no one wants to comment I am going to commit this... it 
can always be reverted later, after all.

> ------------------------------------------------------------------------
> 
> Index: plastik/plastik.cpp
> ===================================================================
> --- plastik/plastik.cpp	(revision 629402)
> +++ plastik/plastik.cpp	(working copy)
> @@ -1346,7 +1346,7 @@
>              int centerx = r.x() + r.width()/2;
>              int centery = r.y() + r.height()/2;
>  
> -            renderContour(p, r, cg.base(), cg.dark(), Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight );
> +            renderContour(p, r, cg.base(), alphaBlendColors(cg.text(), cg.base(), 180), Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight );
>  
>              p->setPen( cg.text() );
>              if(!_drawTriangularExpander)
> @@ -1399,7 +1399,7 @@
>              horizontalLine->setMask( *horizontalLine );
>          }
>  
> -        p->setPen( cg.mid() );
> +        p->setPen( alphaBlendColors( cg.text(), cg.base(), 140 ) );
>  
>          if (flags & Style_Horizontal)
>          {


-- 
Matthew
This message is non-smoking





More information about the kde-core-devel mailing list