added flag to disable drawing of "corners" in shadows.

svn path=/trunk/KDE/kdebase/workspace/; revision=1217366
This commit is contained in:
Hugo Pereira Da Costa 2011-01-26 21:28:39 +00:00
parent df48bd6ebb
commit 37d8ffe6e4
2 changed files with 30 additions and 22 deletions

View file

@ -78,6 +78,7 @@ namespace Oxygen
qreal size( shadowSize() );
TileSet* tileSet = new TileSet( shadowPixmap( color, key, key.active ), size, size, 1, 1);
shadowCache_.insert( hash, tileSet );
return tileSet;
}
@ -299,16 +300,19 @@ namespace Oxygen
}
// draw the corner of the window - actually all 4 corners as one circle
// this is all fixedSize. Does not scale with shadow size
QLinearGradient lg = QLinearGradient(0.0, size-4.5, 0.0, size+4.5);
lg.setColorAt(0.0, helper().calcLightColor( helper().backgroundTopColor(color) ));
lg.setColorAt(0.51, helper().backgroundBottomColor(color) );
lg.setColorAt(1.0, helper().backgroundBottomColor(color) );
if( key.drawCorners )
{
// draw the corner of the window - actually all 4 corners as one circle
// this is all fixedSize. Does not scale with shadow size
QLinearGradient lg = QLinearGradient(0.0, size-4.5, 0.0, size+4.5);
lg.setColorAt(0.0, helper().calcLightColor( helper().backgroundTopColor(color) ));
lg.setColorAt(0.51, helper().backgroundBottomColor(color) );
lg.setColorAt(1.0, helper().backgroundBottomColor(color) );
// draw ellipse.
p.setBrush( lg );
p.drawEllipse( QRectF( size-4, size-4, 8, 8 ) );
// draw ellipse.
p.setBrush( lg );
p.drawEllipse( QRectF( size-4, size-4, 8, 8 ) );
}
// mask
p.setCompositionMode(QPainter::CompositionMode_DestinationOut);

View file

@ -132,17 +132,19 @@ namespace Oxygen
useOxygenShadows(false),
isShade(false),
hasTitleOutline(false),
hasBorder( true )
hasBorder( true ),
drawCorners( true )
{}
//! constructor from int
Key( int hash ):
index( hash>>5 ),
active( (hash>>4)&1 ),
useOxygenShadows( (hash>>3)&1 ),
isShade( (hash>>2)&1 ),
hasTitleOutline( (hash>>1)&1 ),
hasBorder( hash&1 )
index( hash>>6 ),
active( (hash>>5)&1 ),
useOxygenShadows( (hash>>4)&1 ),
isShade( (hash>>3)&1 ),
hasTitleOutline( (hash>>2)&1 ),
hasBorder( (hash>>1)&1 ),
drawCorners( hash&1 )
{}
//! hash function
@ -152,12 +154,13 @@ namespace Oxygen
// note this can be optimized because not all of the flag configurations are actually relevant
// allocate 3 empty bits for flags
return
( index << 5 ) |
( active << 4 ) |
(useOxygenShadows << 3 ) |
(isShade<<2) |
(hasTitleOutline<<1) |
(hasBorder<<0);
( index << 6 ) |
( active << 5 ) |
(useOxygenShadows << 4 ) |
(isShade<<3) |
(hasTitleOutline<<2) |
(hasBorder<<1) |
(drawCorners);
}
@ -167,6 +170,7 @@ namespace Oxygen
bool isShade;
bool hasTitleOutline;
bool hasBorder;
bool drawCorners;
};