summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-15 08:44:25 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-15 08:44:25 +0000
commitc6d80c059c66bc2949fba164b080bb2a6b81bdbd (patch)
tree17cd4f918874399e2466a1e93812dad9c9507d60
parent6963d8ef73192b78503631587366a0110dddd161 (diff)
downloadamarok-c6d80c059c66bc2949fba164b080bb2a6b81bdbd.tar.gz
amarok-c6d80c059c66bc2949fba164b080bb2a6b81bdbd.zip
Fix a couple of graphical glitches in Amarok under ARGB 32 bit visual mode
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/amarok@1247330 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--amarok/src/playerwindow.cpp14
-rw-r--r--amarok/src/sliderwidget.cpp4
2 files changed, 16 insertions, 2 deletions
diff --git a/amarok/src/playerwindow.cpp b/amarok/src/playerwindow.cpp
index 91e03f9f..0e42eff0 100644
--- a/amarok/src/playerwindow.cpp
+++ b/amarok/src/playerwindow.cpp
@@ -45,6 +45,8 @@ email : markey@web.de
#include <kurldrag.h>
#include <kwin.h> //eventFilter()
+#include <kimageeffect.h>
+
//simple function for fetching amarok images
namespace Amarok
{
@@ -54,14 +56,22 @@ namespace Amarok
{
TQString file = !filename.tqendsWith( ".png", false ) ? "amarok/images/%1.png" : "amarok/images/%1";
- return TQPixmap( locate( "data", file.tqarg( filename ) ), "PNG" );
+ TQPixmap pix;
+ TQImage img( locate( "data", file.tqarg( filename ) ), "PNG" );
+ if (TQPaintDevice::x11AppDepth() == 32) pix.convertFromImage(KImageEffect::convertToPremultipliedAlpha( img ));
+ else pix.convertFromImage( img );
+ return pix;
}
TQPixmap getJPG( const TQString &filename )
{
TQString file = !filename.tqendsWith( ".jpg", false ) ? "amarok/images/%1.jpg" : "amarok/images/%1";
- return TQPixmap( locate( "data", TQString( "amarok/images/%1.jpg" ).tqarg( filename ) ), "JPEG" );
+ TQPixmap pix;
+ TQImage img( locate( "data", TQString( "amarok/images/%1.jpg" ).tqarg( filename ) ), "JPEG" );
+ if (TQPaintDevice::x11AppDepth() == 32) pix.convertFromImage(KImageEffect::convertToPremultipliedAlpha( img ));
+ else pix.convertFromImage( img );
+ return pix;
}
}
diff --git a/amarok/src/sliderwidget.cpp b/amarok/src/sliderwidget.cpp
index 15998af7..f0b347ad 100644
--- a/amarok/src/sliderwidget.cpp
+++ b/amarok/src/sliderwidget.cpp
@@ -359,8 +359,11 @@ Amarok::VolumeSlider::VolumeSlider( TQWidget *parent, uint max )
setWFlags( getWFlags() | WNoAutoErase );
setFocusPolicy( TQ_NoFocus );
+ if (TQPaintDevice::x11AppDepth() == 32) m_pixmapInset.convertFromImage(KImageEffect::convertToPremultipliedAlpha( m_pixmapInset.convertToImage() ));
+
// BEGIN Calculate handle animation pixmaps for mouse-over effect
TQImage pixmapHandle ( locate( "data","amarok/images/volumeslider-handle.png" ) );
+ if (TQPaintDevice::x11AppDepth() == 32) pixmapHandle = KImageEffect::convertToPremultipliedAlpha( pixmapHandle );
TQImage pixmapHandleGlow( locate( "data","amarok/images/volumeslider-handle_glow.png" ) );
float opacity = 0.0;
@@ -369,6 +372,7 @@ Amarok::VolumeSlider::VolumeSlider( TQWidget *parent, uint max )
for ( int i = 0; i < ANIM_MAX; ++i ) {
dst = pixmapHandle;
KImageEffect::blend( pixmapHandleGlow, dst, opacity );
+ if (TQPaintDevice::x11AppDepth() == 32) dst = KImageEffect::convertToPremultipliedAlpha( dst );
m_handlePixmaps.append( TQPixmap( dst ) );
opacity += step;
}