Commit f288c34c authored by Hugo Pereira Da Costa's avatar Hugo Pereira Da Costa
Browse files

Render 2px focused outline *inside* frames rather than outside

parent 619545e3
......@@ -200,7 +200,9 @@ namespace Breeze
enum ShadowArea
{
ShadowAreaTop,
ShadowAreaBottom
ShadowAreaBottom,
ShadowAreaLeft,
ShadowAreaRight
};
}
......
......@@ -142,6 +142,8 @@ namespace Breeze
widget->installEventFilter( &_addEventFilter );
installShadow( widget, helper, ShadowAreaTop );
installShadow( widget, helper, ShadowAreaBottom );
installShadow( widget, helper, ShadowAreaLeft );
installShadow( widget, helper, ShadowAreaRight );
widget->removeEventFilter( &_addEventFilter );
}
......@@ -352,6 +354,17 @@ namespace Breeze
cr.adjust( -1, 0, 1, 1 );
break;
case ShadowAreaLeft:
cr.setWidth(ShadowSizeLeft);
cr.adjust(-1, ShadowSizeTop, 0, -ShadowSizeBottom);
break;
case ShadowAreaRight:
cr.setLeft(cr.right() - ShadowSizeRight + 1);
cr.adjust(0, ShadowSizeTop, 1, -ShadowSizeBottom);
break;
default:
return;
}
......@@ -413,7 +426,8 @@ namespace Breeze
{
case ShadowAreaTop: rect.adjust( -frameWidth, -frameWidth, frameWidth, -1 ); break;
case ShadowAreaBottom: rect.adjust( -frameWidth, 1, frameWidth, frameWidth ); break;
case ShadowAreaLeft: rect.adjust( -frameWidth, -2*frameWidth, -1, 2*frameWidth ); break;
case ShadowAreaRight: rect.adjust( -1, -2*frameWidth, frameWidth, 2*frameWidth ); break;
default: return;
}
......
......@@ -205,6 +205,8 @@ namespace Breeze
{
ShadowSizeTop = 3,
ShadowSizeBottom = 3,
ShadowSizeLeft = 3,
ShadowSizeRight = 3
};
//! helper
......
......@@ -370,7 +370,7 @@ namespace Breeze
QRectF frameRect( rect );
const qreal radius( frameRadius() - 0.5 );
frameRect.adjust( 1, 1, -1, -1 );
// set pen
if( outline.isValid() )
{
......@@ -383,14 +383,14 @@ namespace Breeze
} else {
painter->setPen( QPen( outline, 1 ) );
frameRect.adjust( 1.5, 1.5, -1.5, -1.5 );
frameRect.adjust( 0.5, 0.5, -0.5, -0.5 );
}
} else {
painter->setPen( Qt::NoPen );
frameRect.adjust( 1, 1, -1, -1 );
//frameRect.adjust( 1, 1, -1, -1 );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment