diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index 21da080cd0..a956563a47 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -419,14 +419,6 @@ namespace Oxygen QRect OxygenClient::titleBoundingRect( const QFont& font, QRect rect, const QString& caption ) const { - // check bounding rect against titleRect - 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 QRect boundingRect = QFontMetrics( font ).boundingRect( rect, configuration().titleAlignment() | Qt::AlignVCenter, caption ); @@ -927,20 +919,25 @@ namespace Oxygen 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 ); } - + // always make sure that titleRect never conflicts with window buttons + QRect titleRect( OxygenClient::titleRect() ); + if( titleRect.left() > textRect.left() ) { textRect.setLeft( titleRect.left() ); } + if( titleRect.right() < textRect.right() ) { textRect.setRight( titleRect.right() ); } + // title outline if( itemCount == 1 ) { - + if( itemData_.isAnimated() ) { + textRect = titleBoundingRect( painter->font(), textRect, caption ); renderTitleOutline( painter, item.boundingRect_, palette ); } else if( (isActive()||glowIsAnimated()) && configuration().drawTitleOutline() ) { + // adjust textRect + textRect = titleBoundingRect( painter->font(), textRect, caption ); + // adjusts boundingRect accordingly QRect boundingRect( item.boundingRect_ ); boundingRect.setLeft( textRect.left() - layoutMetric( LM_TitleBorderLeft ) ); diff --git a/clients/oxygen/oxygenclient.h b/clients/oxygen/oxygenclient.h index 9a4aa2068c..7636392784 100644 --- a/clients/oxygen/oxygenclient.h +++ b/clients/oxygen/oxygenclient.h @@ -302,15 +302,6 @@ namespace Oxygen !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;