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

List:       kde-commits
Subject:    =?utf-8?q?=5Boxygen-gtk/1=2E0=5D_src=3A_Use_roundSlabFocusedCach?=
From:       Hugo Pereira Da Costa <hugo () oxygen-icons ! org>
Date:       2011-01-31 23:24:52
Message-ID: 20110131232452.CDFE2A609B () git ! kde ! org
[Download RAW message or body]

Git commit ac828dc29e77054766bbaa4981fc5860d02b6386 by Hugo Pereira Da Costa.
Pushed by hpereiradacosta into branch '1.0'.

Use roundSlabFocusedCache for hovered radio buttons

M  +9    -5    src/oxygenstylehelper.cpp     

http://commits.kde.org/oxygen-gtk/ac828dc29e77054766bbaa4981fc5860d02b6386

diff --git a/src/oxygenstylehelper.cpp b/src/oxygenstylehelper.cpp
index 1429802..a749a91 100644
--- a/src/oxygenstylehelper.cpp
+++ b/src/oxygenstylehelper.cpp
@@ -437,13 +437,16 @@ namespace Oxygen
     GdkPixbuf* StyleHelper::roundSlabFocused(const ColorUtils::Rgba& base, const \
ColorUtils::Rgba& glow, double shade, int size)  {
 
-        const int w( 3*size );
-        const int h( 3*size );
-        GdkPixbuf* pixbuf( gdk_pixbuf_new( GDK_COLORSPACE_RGB, true, 8, w, h ) );
-        gdk_pixbuf_fill( pixbuf, ColorUtils::Rgba::transparent( base ).toInt() );
-
+        SlabFocusedKey key( base, glow, shade, size );
+        GdkPixbuf* pixbuf( m_roundSlabFocusedCache.value( key ) );
+        if( !pixbuf )
         {
 
+            const int w( 3*size );
+            const int h( 3*size );
+            pixbuf = gdk_pixbuf_new( GDK_COLORSPACE_RGB, true, 8, w, h );
+            gdk_pixbuf_fill( pixbuf, ColorUtils::Rgba::transparent( base ).toInt() \
); +
             // create cairo context
             Cairo::Context context( pixbuf );
             cairo_scale( context, double(size)/7, double(size)/7 );
@@ -454,6 +457,7 @@ namespace Oxygen
             if( base.isValid() ) drawRoundSlab( context, base, shade );
 
             context.updateGdkPixbuf();
+            m_roundSlabFocusedCache.insert( key, pixbuf );
 
         }
 


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

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