fix so that buttons also have correct bg color when colors are active

!= 
inactive

svn path=/trunk/KDE/kdebase/workspace/; revision=803685
icc-effect-5.14.5
Casper Boemann 2008-05-03 21:02:09 +00:00
parent 9e6e735c86
commit 2826653703
1 changed files with 10 additions and 7 deletions

View File

@ -157,7 +157,16 @@ void OxygenButton::paintEvent(QPaintEvent *)
QPalette pal = palette(); // de-const-ify
helper_.renderWindowBackground(&painter, this->rect(), this);
// Set palette to the right group.
// TODO - fix KWin to do this for us :-).
if (client_.isActive())
pal.setCurrentColorGroup(QPalette::Active);
else
pal.setCurrentColorGroup(QPalette::Inactive);
// widget->window()setPalette(pal);
helper_.renderWindowBackground(&painter, this->rect(), this, pal);
if (type_ == ButtonMenu) {
// we paint the mini icon (which is 16 pixels high)
@ -167,12 +176,6 @@ void OxygenButton::paintEvent(QPaintEvent *)
return;
}
// Set palette to the right group.
// TODO - fix KWin to do this for us :-).
if (client_.isActive())
pal.setCurrentColorGroup(QPalette::Active);
else
pal.setCurrentColorGroup(QPalette::Inactive);
if(client_.maximizeMode() == OxygenClient::MaximizeRestore)
painter.translate(0,-1);