It seems that any QPalette use in KWin has to explicitly specify

the color group, since KWin is technically never the active application.


svn path=/trunk/KDE/kdebase/workspace/; revision=734660
icc-effect-5.14.5
Luboš Luňák 2007-11-09 14:09:29 +00:00
parent bd2bdc040b
commit ad73c931e5
3 changed files with 14 additions and 13 deletions

View File

@ -135,7 +135,7 @@ void PresentWindowsEffect::paintScreen( int mask, QRegion region, ScreenPaintDat
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
// First render the frame
QColor color = QPalette().color( QPalette::Highlight );
QColor color = QPalette().color( QPalette::Active, QPalette::Highlight );
glColor4f( color.redF(), color.greenF(), color.blueF(), 0.75f );
renderRoundBoxWithEdge( filterFrameRect );
// And then the text on top of it
@ -823,7 +823,7 @@ void PresentWindowsEffect::updateFilterTexture()
// Paint the filter text to it
QPainter p( &im );
p.setFont( font );
p.setPen( QPalette().color( QPalette::HighlightedText ) );
p.setPen( QPalette().color( QPalette::Active, QPalette::HighlightedText ) );
p.drawText( rect, Qt::AlignCenter, translatedString );
p.end();
// Create GL texture

View File

@ -85,6 +85,7 @@ void PopupInfo::paintEvent( QPaintEvent* )
QStyleOptionFrame *so = new QStyleOptionFrame;
so->rect = QRect( 0, 0, width(), height() );
so->palette = palette();
so->palette.setCurrentColorGroup( QPalette::Active );
so->state = QStyle::State_None;
style()->drawPrimitive( QStyle::PE_Frame, so, &p );
paintContents();
@ -100,7 +101,7 @@ void PopupInfo::paintContents()
QPainter p( this );
QRect r( 6, 6, width()-12, height()-12 );
p.fillRect( r, palette().brush( QPalette::Background ) );
p.fillRect( r, palette().brush( QPalette::Active, QPalette::Background ) );
/*
p.setPen(Qt::white);

View File

@ -455,7 +455,7 @@ void TabBox::paintEvent( QPaintEvent* e )
{
// draw highlight background
if ( (*it) == currentClient() )
p.fillRect(x, y, r.width(), lineHeight, palette().brush( QPalette::Highlight ));
p.fillRect(x, y, r.width(), lineHeight, palette().brush( QPalette::Active, QPalette::Highlight ));
// draw icon
QPixmap icon;
@ -492,11 +492,11 @@ void TabBox::paintEvent( QPaintEvent* e )
// draw text
if ( (*it) == currentClient() )
p.setPen(palette().color( QPalette::HighlightedText ));
p.setPen(palette().color( QPalette::Active, QPalette::HighlightedText ));
else if( (*it)->isMinimized())
{
QColor c1 = palette().color( QPalette::Text );
QColor c2 = palette().color( QPalette::Background );
QColor c1 = palette().color( QPalette::Active, QPalette::Text );
QColor c2 = palette().color( QPalette::Active, QPalette::Background );
// from kicker's TaskContainer::blendColors()
int r1, g1, b1;
int r2, g2, b2;
@ -511,7 +511,7 @@ void TabBox::paintEvent( QPaintEvent* e )
p.setPen(QColor( r1, g1, b1 ));
}
else
p.setPen(palette().color( QPalette::Text ));
p.setPen(palette().color( QPalette::Active, QPalette::Text ));
p.drawText(x+5 + iconWidth + 8, y, r.width() - 5 - iconWidth - 8, lineHeight,
Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine, s);
@ -546,13 +546,13 @@ void TabBox::paintEvent( QPaintEvent* e )
{
// draw highlight background
if ( it == desk ) // current desktop
p.fillRect(x, y, r.width(), lineHeight, palette().brush( QPalette::Highlight ));
p.fillRect(x, y, r.width(), lineHeight, palette().brush( QPalette::Active, QPalette::Highlight ));
p.save();
// draw "icon" (here: number of desktop)
p.fillRect(x+5, y+2, iconWidth, iconHeight, palette().brush( QPalette::Base ));
p.setPen(palette().color( QPalette::Text ));
p.fillRect(x+5, y+2, iconWidth, iconHeight, palette().brush( QPalette::Active, QPalette::Base ));
p.setPen(palette().color( QPalette::Active, QPalette::Text ));
p.drawRect(x+5, y+2, iconWidth, iconHeight);
// draw desktop-number
@ -564,9 +564,9 @@ void TabBox::paintEvent( QPaintEvent* e )
// draw desktop name text
if ( it == desk )
p.setPen(palette().color( QPalette::HighlightedText ));
p.setPen(palette().color( QPalette::Active, QPalette::HighlightedText ));
else
p.setPen(palette().color( QPalette::Text ));
p.setPen(palette().color( QPalette::Active, QPalette::Text ));
p.drawText(x+5 + iconWidth + 8, y, r.width() - 5 - iconWidth - 8, lineHeight,
Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine,