- fixed rendering glitch because updateTitleRect had too small clip region

- moved check on titleOutline to dedicated inline function
- removed some trailing spaces.

svn path=/trunk/KDE/kdebase/workspace/; revision=1155744
icc-effect-5.14.5
Hugo Pereira Da Costa 2010-07-28 01:07:47 +00:00
parent 1491e9b7d2
commit 5ce103a6e6
2 changed files with 18 additions and 9 deletions

View File

@ -593,9 +593,6 @@ namespace Oxygen
void Client::renderWindowBorder( QPainter* painter, const QRect& clipRect, const QWidget* widget, const QPalette& palette ) const
{
// check if outline is needed
if( clientGroupItems().count() < 2 && !itemData_.isAnimated() && !( isActive() && configuration().drawTitleOutline() ) ) return;
// get coordinates relative to the client area
// this is annoying. One could use mapTo if this was taking const QWidget* and not
// const QWidget* as argument.
@ -1414,7 +1411,9 @@ namespace Oxygen
// window background
renderWindowBackground( &painter, frame, widget(), backgroundPalette( widget(), palette ) );
renderWindowBorder( &painter, frame, widget(), palette );
// window border (for title outline)
if( hasTitleOutline() ) renderWindowBorder( &painter, frame, widget(), palette );
// clipping
if( compositingActive() )

View File

@ -208,8 +208,9 @@ namespace Oxygen
public slots:
//! triggers widget update in titleRect only
/*! one needs to add the title top margin to avoid some clipping glitches */
void updateTitleRect( void )
{ widget()->update( titleRect() ); }
{ widget()->update( titleRect().adjusted( 0, -layoutMetric( LM_TitleEdgeTop ), 0, 0 ) ); }
protected:
@ -327,6 +328,15 @@ namespace Oxygen
!isPreview();
}
//! true if some title outline is rendered
bool hasTitleOutline( void ) const
{
return
clientGroupItems().count() >= 2 ||
itemData_.isAnimated() ||
( isActive() && configuration().drawTitleOutline() );
}
//! calculate mask
QRegion calcMask( void ) const;