From 371b40edbd21241b7aaa0394895ed95378d1ee40 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Sat, 22 Jan 2005 01:13:39 +0000 Subject: [PATCH] Make the shadows work just a little better on dark text svn path=/trunk/kdebase/kwin/; revision=381060 --- clients/keramik/keramik.cpp | 7 +++++-- clients/plastik/plastikclient.cpp | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/clients/keramik/keramik.cpp b/clients/keramik/keramik.cpp index 2f7e3f8e49..109d221ff3 100644 --- a/clients/keramik/keramik.cpp +++ b/clients/keramik/keramik.cpp @@ -1300,8 +1300,11 @@ void KeramikClient::updateCaptionBuffer() if ( clientHandler->useShadowedText() ) { p.translate( QApplication::reverseLayout() ? -1 : 1, 1 ); - p.setPen( options()->color(ColorTitleBar, active).dark() ); - p.setPen( black ); + //p.setPen( options()->color(ColorTitleBar, active).dark() ); + if (qGray(options()->color(ColorFont, active).rgb()) < 100) + p.setPen( QColor(200,200,200) ); + else + p.setPen( black ); p.drawText( tr, flags, caption() ); p.translate( QApplication::reverseLayout() ? 1 : -1, -1 ); } diff --git a/clients/plastik/plastikclient.cpp b/clients/plastik/plastikclient.cpp index 610558b7dc..6117dbe060 100644 --- a/clients/plastik/plastikclient.cpp +++ b/clients/plastik/plastikclient.cpp @@ -996,7 +996,12 @@ void PlastikClient::update_captionBuffer() painter.drawTiledPixmap(aCaptionBuffer->rect(), *aTitleBarTile); if(PlastikHandler::titleShadow()) { - shadow = se.makeShadow(textPixmap, QColor(0, 0, 0)); + QColor shadowColor; + if (qGray(PlastikHandler::getColor(TitleFont,true).rgb()) < 100) + shadowColor = QColor(255, 255, 255); + else + shadowColor = QColor(0,0,0); + shadow = se.makeShadow(textPixmap, shadowColor); painter.drawImage(1, 1, shadow); } painter.setFont(s_titleFont);