::(Style/Deco/)Helper - variable names cleanup
moved all caches to Private; added protected accessor, and updated daughter classes accordingly. Also renamed variables for consistency with other classes
This commit is contained in:
parent
3c5c517220
commit
1aeb5fedcc
2 changed files with 11 additions and 11 deletions
|
@ -32,7 +32,7 @@ namespace Oxygen
|
||||||
//______________________________________________________________________________
|
//______________________________________________________________________________
|
||||||
DecoHelper::DecoHelper(const QByteArray &componentName):
|
DecoHelper::DecoHelper(const QByteArray &componentName):
|
||||||
Helper(componentName),
|
Helper(componentName),
|
||||||
m_debugArea( KDebug::registerArea( "Oxygen (decoration)" ) )
|
_debugArea( KDebug::registerArea( "Oxygen (decoration)" ) )
|
||||||
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ namespace Oxygen
|
||||||
Helper::invalidateCaches();
|
Helper::invalidateCaches();
|
||||||
|
|
||||||
// local caches
|
// local caches
|
||||||
m_titleBarTextColorCache.clear();
|
_titleBarTextColorCache.clear();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ namespace Oxygen
|
||||||
QPixmap DecoHelper::windecoButton(const QColor &color, bool pressed, int size)
|
QPixmap DecoHelper::windecoButton(const QColor &color, bool pressed, int size)
|
||||||
{
|
{
|
||||||
const quint64 key( (quint64(color.rgba()) << 32) | (size << 1) | (int)pressed );
|
const quint64 key( (quint64(color.rgba()) << 32) | (size << 1) | (int)pressed );
|
||||||
QPixmap *pixmap( m_windecoButtonCache.object(key) );
|
QPixmap *pixmap( windecoButtonCache().object(key) );
|
||||||
|
|
||||||
if( !pixmap )
|
if( !pixmap )
|
||||||
{
|
{
|
||||||
|
@ -97,7 +97,7 @@ namespace Oxygen
|
||||||
p.end();
|
p.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_windecoButtonCache.insert( key, pixmap );
|
windecoButtonCache().insert( key, pixmap );
|
||||||
}
|
}
|
||||||
|
|
||||||
return *pixmap;
|
return *pixmap;
|
||||||
|
@ -107,7 +107,7 @@ namespace Oxygen
|
||||||
QPixmap DecoHelper::windecoButtonGlow(const QColor &color, int size)
|
QPixmap DecoHelper::windecoButtonGlow(const QColor &color, int size)
|
||||||
{
|
{
|
||||||
const quint64 key( (quint64(color.rgba()) << 32) | size );
|
const quint64 key( (quint64(color.rgba()) << 32) | size );
|
||||||
QPixmap *pixmap( m_windecoButtonGlowCache.object(key) );
|
QPixmap *pixmap( windecoButtonGlowCache().object(key) );
|
||||||
|
|
||||||
if( !pixmap )
|
if( !pixmap )
|
||||||
{
|
{
|
||||||
|
@ -157,7 +157,7 @@ namespace Oxygen
|
||||||
p.drawRect( r );
|
p.drawRect( r );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_windecoButtonGlowCache.insert( key, pixmap );
|
windecoButtonGlowCache().insert( key, pixmap );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ namespace Oxygen
|
||||||
{
|
{
|
||||||
|
|
||||||
const quint32 key( palette.color(QPalette::Active, QPalette::Window).rgba() );
|
const quint32 key( palette.color(QPalette::Active, QPalette::Window).rgba() );
|
||||||
QColor* out( m_titleBarTextColorCache.object( key ) );
|
QColor* out( _titleBarTextColorCache.object( key ) );
|
||||||
if( !out )
|
if( !out )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ namespace Oxygen
|
||||||
const QColor nb = palette.color(QPalette::Inactive, QPalette::Window);
|
const QColor nb = palette.color(QPalette::Inactive, QPalette::Window);
|
||||||
const QColor nf = palette.color(QPalette::Inactive, QPalette::WindowText);
|
const QColor nf = palette.color(QPalette::Inactive, QPalette::WindowText);
|
||||||
out = new QColor( reduceContrast(nb, nf, qMax(qreal(2.5), KColorUtils::contrastRatio(ab, KColorUtils::mix(ab, af, 0.4)))) );
|
out = new QColor( reduceContrast(nb, nf, qMax(qreal(2.5), KColorUtils::contrastRatio(ab, KColorUtils::mix(ab, af, 0.4)))) );
|
||||||
m_titleBarTextColorCache.insert( key, out );
|
_titleBarTextColorCache.insert( key, out );
|
||||||
}
|
}
|
||||||
|
|
||||||
return *out;
|
return *out;
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace Oxygen
|
||||||
|
|
||||||
//! dynamically allocated debug area
|
//! dynamically allocated debug area
|
||||||
int debugArea( void ) const
|
int debugArea( void ) const
|
||||||
{ return m_debugArea; }
|
{ return _debugArea; }
|
||||||
|
|
||||||
//! reset all caches
|
//! reset all caches
|
||||||
virtual void invalidateCaches();
|
virtual void invalidateCaches();
|
||||||
|
@ -68,10 +68,10 @@ namespace Oxygen
|
||||||
private:
|
private:
|
||||||
|
|
||||||
//! dynamically allocated debug area
|
//! dynamically allocated debug area
|
||||||
int m_debugArea;
|
int _debugArea;
|
||||||
|
|
||||||
//! titleBar text color cache
|
//! titleBar text color cache
|
||||||
ColorCache m_titleBarTextColorCache;
|
ColorCache _titleBarTextColorCache;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue