From a93f71ab57d08689980c045e83b433a4217566d2 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Wed, 29 Aug 2012 14:51:14 +0200 Subject: [PATCH] properly deal with invalid colors when calculating cache keys. using color.rgba() for an invalid color corresponds to solid black, which in turns conflicts with the cache value for such color. We use "transparent black" instead. CCBUG: 304868 --- clients/oxygen/oxygendecohelper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/oxygen/oxygendecohelper.cpp b/clients/oxygen/oxygendecohelper.cpp index f8cea7a5bf..91d8b64d95 100644 --- a/clients/oxygen/oxygendecohelper.cpp +++ b/clients/oxygen/oxygendecohelper.cpp @@ -55,7 +55,7 @@ namespace Oxygen Oxygen::Cache::Value* cache( _windecoButtonCache.get( color ) ); - const quint64 key( ( quint64( glow.rgba() ) << 32 ) | (sunken << 23 ) | size ); + const quint64 key( ( colorKey(glow) << 32 ) | (sunken << 23 ) | size ); QPixmap *pixmap = cache->object( key ); if( !pixmap ) @@ -151,7 +151,7 @@ namespace Oxygen const QColor& DecoHelper::inactiveTitleBarTextColor( const QPalette& palette ) { - const quint32 key( palette.color(QPalette::Active, QPalette::Window).rgba() ); + const quint32 key( colorKey( palette.color(QPalette::Active, QPalette::Window) ) ); QColor* out( _titleBarTextColorCache.object( key ) ); if( !out ) { @@ -173,7 +173,7 @@ namespace Oxygen const QColor& DecoHelper::inactiveButtonTextColor( const QPalette& palette ) { - const quint32 key( palette.color(QPalette::Active, QPalette::Window).rgba() ); + const quint32 key( colorKey( palette.color(QPalette::Active, QPalette::Window) ) ); QColor* out( _buttonTextColorCache.object( key ) ); if( !out ) {