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

!= 
inactive

svn path=/trunk/KDE/kdebase/workspace/; revision=803685
This commit is contained in:
Casper Boemann 2008-05-03 21:02:09 +00:00
parent 9e6e735c86
commit 2826653703

View file

@ -157,7 +157,16 @@ void OxygenButton::paintEvent(QPaintEvent *)
QPalette pal = palette(); // de-const-ify 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) { if (type_ == ButtonMenu) {
// we paint the mini icon (which is 16 pixels high) // we paint the mini icon (which is 16 pixels high)
@ -167,12 +176,6 @@ void OxygenButton::paintEvent(QPaintEvent *)
return; 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) if(client_.maximizeMode() == OxygenClient::MaximizeRestore)
painter.translate(0,-1); painter.translate(0,-1);