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

List:       kde-commits
Subject:    KDE/kdebase/runtime/kstyles/oxygen
From:       Hugo Pereira Da Costa <hugo.pereira () free ! fr>
Date:       2010-01-30 23:15:23
Message-ID: 1264893323.229741.22847.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1082616 by hpereiradacosta:

prevent call to renderWindowBackground if one parent has autoFillBackground set to \
true when painting 'clip' rect in overflown tabbars. Also uses the correct palette in \
                all cases (from parent), to draw background. 
BUG: 224930


 M  +31 -3     oxygen.cpp  
 M  +3 -0      oxygen.h  


--- trunk/KDE/kdebase/runtime/kstyles/oxygen/oxygen.cpp #1082615:1082616
@@ -1720,7 +1720,13 @@
 
             if( !(documentMode && flags&State_Selected) )
             {
-                if( clip.isValid() ) _helper.renderWindowBackground(p, clip, widget, \
pal); +                // clipping is done by drawing the 
+                // window background over the requested rect
+                if( clip.isValid() ) 
+                {
+                    if( checkAutoFillBackground( widget ) ) p->fillRect( clip, \
pal.color( widget->backgroundRole() ) ); +                    else \
_helper.renderWindowBackground(p, clip, widget, pal); +                }
                 renderSlab(p, rect, opt->palette.color(QPalette::Window), NoFill, \
tiles );  }
             return true;
@@ -3081,8 +3087,16 @@
                         break;
                     }
 
-
-                    if( clipRect.isValid() ) _helper.renderWindowBackground(p, \
clipRect, t, t->window()->palette()); +                    if( clipRect.isValid() ) 
+                    {
+                        QPalette local( t->parentWidget() ? \
t->parentWidget()->palette() : pal ); +                        
+                        // check whether parent has autofill background flag
+                        if( checkAutoFillBackground( t ) ) p->fillRect( clipRect, \
local.color( t->backgroundRole() ) ); +                        else \
_helper.renderWindowBackground(p, clipRect, t, local); +                        
+                    }
+                    
                     if( slabRect.isValid() )
                     {
                         p->save();
@@ -6330,6 +6344,20 @@
 }
 
 //____________________________________________________________________
+bool OxygenStyle::checkAutoFillBackground( const QWidget* w ) const
+{
+    if( w->autoFillBackground() ) return true;
+    for( const QWidget* parent = w->parentWidget(); parent!=0; parent = \
parent->parentWidget() ) +    {
+        if( parent->autoFillBackground() ) return true;
+        if( parent == w->window() ) break;
+    }
+    
+    return false;
+    
+}
+
+//____________________________________________________________________
 QIcon OxygenStyle::standardIconImplementation(StandardPixmap standardIcon, const \
                QStyleOption *option,
                                                const QWidget *widget) const
 {
--- trunk/KDE/kdebase/runtime/kstyles/oxygen/oxygen.h #1082615:1082616
@@ -303,6 +303,9 @@
     //! returns true if compositing is active
     bool compositingActive( void ) const;
 
+    //! returns true if one of the parent of a widget has its autofillbackground set \
to true +    bool checkAutoFillBackground( const QWidget* ) const;
+    
     protected Q_SLOTS:
 
     //! standard icons


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

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