From 7e8a0fc428098023f8a06ff607c43e24b7e8bbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 29 Oct 2001 15:29:14 +0000 Subject: [PATCH] Workaround for a Qt bug. svn path=/trunk/kdebase/kwin/; revision=119819 --- clients/default/kdedefault.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/clients/default/kdedefault.cpp b/clients/default/kdedefault.cpp index cf2d646a74..30bcfd49be 100644 --- a/clients/default/kdedefault.cpp +++ b/clients/default/kdedefault.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -532,11 +533,14 @@ void KDEDefaultButton::drawButton(QPainter *p) // Intensify the image if required if (isMouseOver) { - const QBitmap* mask = btnpix.mask(); - if( mask != 0 ) { - btnpix.detach(); - btnpix = KPixmapEffect::intensity(btnpix, 0.8); - btnpix.setMask( *mask ); + if( btnpix.mask() != 0 ) { + QBitmap save_mask = *btnpix.mask(); + QImage image = btnpix.convertToImage(); + KImageEffect::intensity(image, 0.8); + // fix Qt problem, when QPixmap has alpha channel, mask is ignored + image.setAlphaBuffer( false ); + btnpix.convertFromImage(image); + btnpix.setMask( save_mask ); } }