summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 : [email protected]
#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;
}