Fixed glow animation for outlined windows.

This commit is contained in:
Hugo Pereira Da Costa 2011-10-05 23:01:13 +02:00
parent 066927ebfb
commit 885e42142f
2 changed files with 15 additions and 4 deletions

View file

@ -673,6 +673,10 @@ namespace Oxygen
// base color
QColor color( palette.window().color() );
// add alpha channel
if( _itemData.count() == 1 && glowIsAnimated() )
{ color = helper().alphaColor( color, glowIntensity() ); }
// title height
const int titleHeight( layoutMetric( LM_TitleEdgeTop ) + layoutMetric( LM_TitleEdgeBottom ) + layoutMetric( LM_TitleHeight ) );
@ -702,7 +706,7 @@ namespace Oxygen
// adjustements to cope with shadow size and outline border.
rect.adjust( -shadowSize, 0, shadowSize-1, 0 );
if( configuration().drawTitleOutline() && isActive() && !isMaximized() )
if( configuration().drawTitleOutline() && ( isActive() || glowIsAnimated() ) && !isMaximized() )
{
if( configuration().frameBorder() == Configuration::BorderTiny ) rect.adjust( 1, 0, -1, 0 );
else if( configuration().frameBorder() > Configuration::BorderTiny ) rect.adjust( HFRAMESIZE-1, 0, -HFRAMESIZE+1, 0 );
@ -713,7 +717,7 @@ namespace Oxygen
}
if( configuration().drawTitleOutline() && isActive() )
if( configuration().drawTitleOutline() && ( isActive() || glowIsAnimated() ) )
{
// save old hints and turn off anti-aliasing
@ -858,7 +862,14 @@ namespace Oxygen
const int offset( -3 );
const int voffset( 5-shadowSize );
const QRect adjustedRect( rect.adjusted(offset, voffset, -offset, shadowSize) );
helper().slab( palette.color( widget()->backgroundRole() ), 0, shadowSize )->render( adjustedRect, painter, TileSet::Tiles(TileSet::Top|TileSet::Left|TileSet::Right) );
QColor color( palette.color( widget()->backgroundRole() ) );
// add alpha channel
if( _itemData.count() == 1 && glowIsAnimated() )
{ color = helper().alphaColor( color, glowIntensity() ); }
// render slab
helper().slab( color, 0, shadowSize )->render( adjustedRect, painter, TileSet::Tiles(TileSet::Top|TileSet::Left|TileSet::Right) );
}

View file

@ -360,7 +360,7 @@ namespace Oxygen
return
clientGroupItems().count() >= 2 ||
_itemData.isAnimated() ||
( isActive() && configuration().drawTitleOutline() );
( (isActive()||glowIsAnimated()) && configuration().drawTitleOutline() );
}
//! calculate mask