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

List:       kde-commits
Subject:    branches/KDE/4.4/kdebase/runtime/kstyles/oxygen
From:       Hugo Pereira Da Costa <hugo.pereira () free ! fr>
Date:       2010-01-31 22:48:40
Message-ID: 1264978120.078539.31826.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1083267 by hpereiradacosta:

Backport: r1083260
return QWidget, or NULL in checkAutoFillBackground, to make sure the right color is \
used for  plain background painting when needed



 M  +7 -7      oxygen.cpp  
 M  +5 -2      oxygen.h  


--- branches/KDE/4.4/kdebase/runtime/kstyles/oxygen/oxygen.cpp #1083266:1083267
@@ -1724,7 +1724,7 @@
                 // window background over the requested rect
                 if( clip.isValid() ) 
                 {
-                    if( checkAutoFillBackground( widget ) ) p->fillRect( clip, \
pal.color( widget->backgroundRole() ) ); +                    if( const QWidget* \
parent = checkAutoFillBackground( widget ) ) p->fillRect( clip, \
                parent->palette().color( parent->backgroundRole() ) );
                     else _helper.renderWindowBackground(p, clip, widget, pal);
                 }
                 renderSlab(p, rect, opt->palette.color(QPalette::Window), NoFill, \
tiles ); @@ -3092,7 +3092,7 @@
                         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() ) ); +                        if( const QWidget* \
parent = checkAutoFillBackground( t ) ) p->fillRect( clipRect, \
                parent->palette().color( parent->backgroundRole() ) );
                         else _helper.renderWindowBackground(p, clipRect, t, local);
                         
                     }
@@ -6344,17 +6344,17 @@
 }
 
 //____________________________________________________________________
-bool OxygenStyle::checkAutoFillBackground( const QWidget* w ) const
+const QWidget* OxygenStyle::checkAutoFillBackground( const QWidget* w ) const
 {
-    if( w->autoFillBackground() ) return true;
+    if( !w ) return NULL;
+    if( w->autoFillBackground() ) return w;
     for( const QWidget* parent = w->parentWidget(); parent!=0; parent = \
parent->parentWidget() )  {
-        if( parent->autoFillBackground() ) return true;
+        if( parent->autoFillBackground() ) return parent;
         if( parent == w->window() ) break;
     }
     
-    return false;
-    
+    return NULL;
 }
 
 //____________________________________________________________________
--- branches/KDE/4.4/kdebase/runtime/kstyles/oxygen/oxygen.h #1083266:1083267
@@ -303,8 +303,11 @@
     //! 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;
+    /*! 
+    returns first widget in parent chain that sets autoFillBackground to true,
+    or NULL if none
+    */
+    const QWidget* checkAutoFillBackground( const QWidget* ) const;
     
     protected Q_SLOTS:
 


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

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