Workaround for a Qt bug.
svn path=/trunk/kdebase/kwin/; revision=119819
This commit is contained in:
parent
121e745651
commit
7e8a0fc428
1 changed files with 9 additions and 5 deletions
|
@ -14,6 +14,7 @@
|
||||||
#include <kconfig.h>
|
#include <kconfig.h>
|
||||||
#include <kglobal.h>
|
#include <kglobal.h>
|
||||||
#include <kpixmapeffect.h>
|
#include <kpixmapeffect.h>
|
||||||
|
#include <kimageeffect.h>
|
||||||
#include <kdrawutil.h>
|
#include <kdrawutil.h>
|
||||||
#include <klocale.h>
|
#include <klocale.h>
|
||||||
#include <qlayout.h>
|
#include <qlayout.h>
|
||||||
|
@ -532,11 +533,14 @@ void KDEDefaultButton::drawButton(QPainter *p)
|
||||||
|
|
||||||
// Intensify the image if required
|
// Intensify the image if required
|
||||||
if (isMouseOver) {
|
if (isMouseOver) {
|
||||||
const QBitmap* mask = btnpix.mask();
|
if( btnpix.mask() != 0 ) {
|
||||||
if( mask != 0 ) {
|
QBitmap save_mask = *btnpix.mask();
|
||||||
btnpix.detach();
|
QImage image = btnpix.convertToImage();
|
||||||
btnpix = KPixmapEffect::intensity(btnpix, 0.8);
|
KImageEffect::intensity(image, 0.8);
|
||||||
btnpix.setMask( *mask );
|
// fix Qt problem, when QPixmap has alpha channel, mask is ignored
|
||||||
|
image.setAlphaBuffer( false );
|
||||||
|
btnpix.convertFromImage(image);
|
||||||
|
btnpix.setMask( save_mask );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue