more subtle changes to drawFloatFrame

svn path=/trunk/KDE/kdebase/workspace/; revision=1032457
This commit is contained in:
Hugo Pereira Da Costa 2009-10-07 21:24:23 +00:00
parent 6532a7445c
commit a6db3e0b09
2 changed files with 34 additions and 42 deletions

View file

@ -907,40 +907,43 @@ namespace Oxygen
if( compositingActive() ) frame.adjust(-1,-1, 1, 1);
// shadow and resize handles
if( !isMaximized() )
if( true )
{
if( configuration().frameBorder() >= OxygenConfiguration::BorderTiny )
if( !isMaximized() )
{
if( configuration().frameBorder() >= OxygenConfiguration::BorderTiny )
{
helper().drawFloatFrame(
&painter, frame, backgroundPalette( widget(), palette ).color( widget()->backgroundRole() ),
!compositingActive(), isActive() && configuration().useOxygenShadows(),
KDecoration::options()->color(ColorTitleBar)
);
} else {
// for tiny borders, use a frame that matches the titlebar only
QRect local( frame.topLeft(), QSize( frame.width(), layoutMetric(LM_TitleHeight) + layoutMetric(LM_TitleEdgeTop) ) );
helper().drawFloatFrame(
&painter, local, backgroundPalette( widget(), palette ).color( widget()->backgroundRole() ),
false, isActive() && configuration().useOxygenShadows(),
KDecoration::options()->color(ColorTitleBar)
);
}
} else if( isShade() ) {
// for shaded maximized windows adjust frame and draw the bottom part of it
helper().drawFloatFrame(
&painter, frame, backgroundPalette( widget(), palette ).color( widget()->backgroundRole() ),
!compositingActive(), isActive() && configuration().useOxygenShadows(),
KDecoration::options()->color(ColorTitleBar)
);
} else {
QRect local( frame.topLeft(), QSize( frame.width(), layoutMetric(LM_TitleHeight) + layoutMetric(LM_TitleEdgeTop) ) );
helper().drawFloatFrame(
&painter, local, backgroundPalette( widget(), palette ).color( widget()->backgroundRole() ),
false, isActive() && configuration().useOxygenShadows(),
&painter, frame.adjusted( -4, 0, 4, 0 ), backgroundPalette( widget(), palette ).color( widget()->backgroundRole() ),
!compositingActive(), isActive(),
KDecoration::options()->color(ColorTitleBar),
TileSet::Top
TileSet::Bottom
);
}
} else if( isShade() ) {
// for shaded maximized windows adjust frame and draw the bottom part of it
helper().drawFloatFrame(
&painter, frame.adjusted( -4, 0, 4, 0 ), backgroundPalette( widget(), palette ).color( widget()->backgroundRole() ),
!compositingActive(), isActive(),
KDecoration::options()->color(ColorTitleBar),
TileSet::Bottom
);
}
if( configuration().frameBorder() >= OxygenConfiguration::BorderTiny )
@ -955,8 +958,9 @@ namespace Oxygen
{
// Draw the 3-dots resize handles
qreal cenY = h / 2 + x + 0.5;
qreal posX = w + y - 2.5;
qreal cenY = h / 2 + y + 0.5;
qreal posX = w + x - 2.5;
painter.setPen(Qt::NoPen);
painter.setBrush(QColor(0, 0, 0, 66));
renderDot(&painter, QPointF(posX, cenY - 3), 1.8);

View file

@ -290,21 +290,9 @@ 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);
if( key.frameBorder < Key::BorderAny )
{
lg.setColorAt(0.52, oxygenHelper()->backgroundTopColor(color));
lg.setColorAt(1.0, oxygenHelper()->backgroundBottomColor(color) );
} else {
QColor light = oxygenHelper()->calcLightColor( oxygenHelper()->backgroundTopColor(color) );
QColor dark = oxygenHelper()->calcDarkColor( oxygenHelper()->backgroundBottomColor(color));
lg.setColorAt(0.52, light);
lg.setColorAt(1.0, dark);
}
lg.setColorAt(0.0, oxygenHelper()->calcLightColor( oxygenHelper()->backgroundTopColor(color) ));
lg.setColorAt(0.52, oxygenHelper()->backgroundTopColor(color) );
lg.setColorAt(1.0, oxygenHelper()->backgroundBottomColor(color) );
// draw ellipse.
// note: special tricks are needed to cope with some rounding issues when size is not an integer.