|
|
|
|
@ -474,21 +474,51 @@ namespace Breeze |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
|
void Helper::renderSidePanelFrame( QPainter* painter, const QRect& rect, const QColor& outline ) const |
|
|
|
|
void Helper::renderSidePanelFrame( QPainter* painter, const QRect& rect, const QColor& outline, Side side ) const |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
painter->setRenderHint( QPainter::Antialiasing ); |
|
|
|
|
// check color
|
|
|
|
|
if( !outline.isValid() ) return; |
|
|
|
|
|
|
|
|
|
QRectF frameRect( rect.adjusted( 1, 2, -1, -2 ) ); |
|
|
|
|
// adjust rect
|
|
|
|
|
QRectF frameRect( rect.adjusted( 1, 1, -1, -1 ) ); |
|
|
|
|
frameRect.adjust( 0.5, 0.5, -0.5, -0.5 ); |
|
|
|
|
|
|
|
|
|
// set pen
|
|
|
|
|
if( outline.isValid() ) |
|
|
|
|
// setup painter
|
|
|
|
|
painter->setRenderHint( QPainter::Antialiasing ); |
|
|
|
|
painter->setPen( outline ); |
|
|
|
|
|
|
|
|
|
// render
|
|
|
|
|
switch( side ) |
|
|
|
|
{ |
|
|
|
|
default: |
|
|
|
|
case SideLeft: |
|
|
|
|
frameRect.adjust( 0, 1, 0, -1 ); |
|
|
|
|
painter->drawLine( frameRect.topRight(), frameRect.bottomRight() ); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
painter->setPen( outline ); |
|
|
|
|
frameRect.adjust( 0.5, 0.5, -0.5, -0.5 ); |
|
|
|
|
case SideTop: |
|
|
|
|
frameRect.adjust( 1, 0, -1, 0 ); |
|
|
|
|
painter->drawLine( frameRect.topLeft(), frameRect.topRight() ); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
painter->drawLine( frameRect.topRight(), frameRect.bottomRight() ); |
|
|
|
|
case SideRight: |
|
|
|
|
frameRect.adjust( 0, 1, 0, -1 ); |
|
|
|
|
painter->drawLine( frameRect.topLeft(), frameRect.bottomLeft() ); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case SideBottom: |
|
|
|
|
frameRect.adjust( 1, 0, -1, 0 ); |
|
|
|
|
painter->drawLine( frameRect.bottomLeft(), frameRect.bottomRight() ); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case AllSides: |
|
|
|
|
{ |
|
|
|
|
qreal radius( frameRadius() ); |
|
|
|
|
radius -= 1.0; |
|
|
|
|
painter->drawRoundedRect( frameRect, radius, radius ); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|