[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/multimedia/amarok/src
From:       Seb Ruiz <me () sebruiz ! net>
Date:       2006-11-26 1:32:27
Message-ID: 1164504747.369796.18753.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 607872 by seb:

Respect the users font size and colour for the volume osd label, and make the pixmap and masks static


 M  +10 -12    osd.cpp  


--- trunk/extragear/multimedia/amarok/src/osd.cpp #607871:607872
@@ -335,18 +335,18 @@
         r.setLeft(( rect.left() + rect.width() / 2 ) - vol.width() / 2  );
         r.setTop( rect.bottom()  - vol.height() - M / 2 );
 
-        const QPixmap temp( locate( "data", "amarok/images/osdvolumeslider-gradient.png" ) );
-        const QBitmap mask( temp.createHeuristicMask() );
+        static const QPixmap temp( locate( "data", "amarok/images/osdvolumeslider-gradient.png" ) );
+        static const QBitmap mask( temp.createHeuristicMask() );
 
-        KPixmap m_pixmapGradient;
-        m_pixmapGradient = QPixmap( vol.size() );
-        KPixmapEffect::gradient( m_pixmapGradient, colorGroup().background(), colorGroup().highlight(),
+        static KPixmap s_pixmapGradient;
+        s_pixmapGradient = QPixmap( vol.size() );
+        KPixmapEffect::gradient( s_pixmapGradient, colorGroup().background(), colorGroup().highlight(),
                  KPixmapEffect::EllipticGradient );
-        m_pixmapGradient.setMask( mask );
+        s_pixmapGradient.setMask( mask );
 
         QPixmap buf( vol.size() );
 
-        if( m_translucency ) 
+        if( m_translucency )
         {
             KPixmap background( m_screenshot );
             KPixmapEffect::fade( background, 0.80, backgroundColor() );
@@ -357,15 +357,13 @@
 
         const int offset = int( double( vol.width() * m_newvolume ) / 100 );
 
-        bitBlt( &buf, 0, 0, &m_pixmapGradient, 0, 0, offset );
+        bitBlt( &buf, 0, 0, &s_pixmapGradient, 0, 0, offset );
         bitBlt( &buf, 0, 0, &vol );  // bg
 
         { // label
             QPainter p2( &buf );
-            p2.setPen( Qt::white  );
-            QFont font2;
-            font2.setPixelSize( 14 );
-            p2.setFont( font2 );
+            p2.setPen( foregroundColor() );
+            p2.setFont( font() );
             const QRect rect2( 0, 0, vol.width(), vol.height() );
             p2.drawText( rect2, Qt::AlignCenter | Qt::AlignVCenter,
                 m_newvolume ? i18n("Volume: %1%").arg( m_newvolume ) : i18n("Mute") );
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic