From 28266537033baad847337995a63ac8c63c4b6b0c Mon Sep 17 00:00:00 2001 From: Casper Boemann Date: Sat, 3 May 2008 21:02:09 +0000 Subject: [PATCH] fix so that buttons also have correct bg color when colors are active != inactive svn path=/trunk/KDE/kdebase/workspace/; revision=803685 --- clients/oxygen/oxygenbutton.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/clients/oxygen/oxygenbutton.cpp b/clients/oxygen/oxygenbutton.cpp index 8176788d4b..d9a2f3ee93 100644 --- a/clients/oxygen/oxygenbutton.cpp +++ b/clients/oxygen/oxygenbutton.cpp @@ -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);