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

List:       kde-commits
Subject:    branches/KDE/4.4/kdebase/workspace/kwin/clients/oxygen
From:       Hugo Pereira Da Costa <hugo.pereira () free ! fr>
Date:       2010-01-23 7:05:46
Message-ID: 1264230346.831337.2017.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1078907 by hpereiradacosta:

Backport: r1078906
fixed title bounding rect conflict with window buttons when dragging a tab away from \
(or back  in) a 2-tabs window, with the second tab title being very long



 M  +8 -6      oxygenclient.cpp  
 M  +9 -0      oxygenclient.h  


--- branches/KDE/4.4/kdebase/workspace/kwin/clients/oxygen/oxygenclient.cpp \
#1078906:1078907 @@ -420,13 +420,11 @@
   {
 
     // check bounding rect against titleRect
-    // conflicts can happen only if there is only one item in group
-    if( itemData_.count() == 1 )
+    if( titleRectCanConflict() ) 
     {
       QRect titleRect( OxygenClient::titleRect() );
       if( titleRect.left() > rect.left() ) { rect.setLeft( titleRect.left() ); }
       if( titleRect.right() < rect.right() ) { rect.setRight( titleRect.right() ); }
-
     }
 
     // get title bounding rect
@@ -929,10 +927,14 @@
     const QList< ClientGroupItem >& items( clientGroupItems() );
     QString caption( itemCount == 1 ? OxygenClient::caption() : items[index].title() \
);  
+    // make sure title rect never conflicts with decoration buttons
+    if( titleRectCanConflict() ) 
+    { textRect = titleBoundingRect( painter->font(), textRect, caption ); }
+    
     // title outline
-    if( itemCount == 1 ) {
-
-      textRect = titleBoundingRect( painter->font(), textRect, caption );
+    if( itemCount == 1 )
+    {
+        
       if( itemData_.isAnimated() ) {
 
         renderTitleOutline( painter, item.boundingRect_, palette );
--- branches/KDE/4.4/kdebase/workspace/kwin/clients/oxygen/oxygenclient.h \
#1078906:1078907 @@ -302,6 +302,15 @@
                 !isPreview();
         }
 
+        //! returns true if drawn item can conflict with buttons.
+        /*! 
+        this might happen either
+        - when there is only one item in the group
+        - when there are two items but the second is being dragged in or away
+        */
+        bool titleRectCanConflict( void ) const
+        {  return ( itemData_.count() == 1 || ( itemData_.count() == 2 && \
(itemData_.animationType()&AnimationSameTarget) ) ); } +        
         //! calculate mask
         QRegion calcMask( void ) const;
 


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

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