Skip to content

Commit

Permalink
many fixes to border lines (fixes issue #35)
Browse files Browse the repository at this point in the history
  • Loading branch information
kupiqu committed Nov 21, 2019
1 parent c3873c4 commit 80d4e41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 42 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
V0.5.2
---------

* Fixes border lines according to titlebarColor
* Many fixes to border lines

V0.5.1
---------
Expand Down
47 changes: 6 additions & 41 deletions breezedecoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,27 +700,9 @@ namespace Breeze
// clip away the top part
// if( !hideTitleBar() ) painter->setClipRect(0, borderTop(), size().width(), size().height() - borderTop(), Qt::IntersectClip);

QPen border_pen1( QColor(81, 102, 107) );
border_pen1.setWidthF( 2 );
QPen border_pen1( titleBarColor.darker( 125 ) );
painter->setPen(border_pen1);
if( s->isAlphaChannelSupported() ) painter->drawRoundedRect(rect().adjusted( 1, 1, -1, -1 ), m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
else painter->drawRect( rect().adjusted( 1, 1, -1, -1 ) );

QColor borderColor2( );
QPen border_pen2( QColor(255, 255, 0) );
border_pen2.setWidthF( 0.5 );
painter->setPen(border_pen2);
if( s->isAlphaChannelSupported() ) painter->drawRoundedRect(rect().adjusted( 1.5, 1.5, -1.5, -1.5 ), m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
else painter->drawRect( rect().adjusted( 1.5, 1.5, -1.5, -1.5 ) );

QColor borderColor3( c->isActive() ?
titleBarColor :
c->color( ColorGroup::Inactive, ColorRole::Frame ) );
QPen border_pen3( borderColor3 );
border_pen3.setWidthF( 0.5 );
painter->setPen(border_pen3);
if( s->isAlphaChannelSupported() ) painter->drawRoundedRect(rect().adjusted( 2, 2, -2, -2 ), m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
else painter->drawRect( rect().adjusted( 2, 2, -2, -2 ) );
painter->drawRoundedRect(rect().adjusted( 0, 0, -1, -1 ), m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());

painter->restore();
}
Expand All @@ -733,26 +715,9 @@ namespace Breeze
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setBrush( Qt::NoBrush );

QPen border_pen1( QColor(81, 102, 107) );
border_pen1.setWidthF( 2 );
QPen border_pen1( titleBarColor.darker( 125 ) );
painter->setPen(border_pen1);
if( s->isAlphaChannelSupported() ) painter->drawRoundedRect(rect().adjusted( 1, 1, -1, -1 ), m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
else painter->drawRect( rect().adjusted( 1, 1, -1, -1 ) );

QPen border_pen2( QColor(255, 255, 0) );
border_pen2.setWidthF( 0.5 );
painter->setPen(border_pen2);
if( s->isAlphaChannelSupported() ) painter->drawRoundedRect(rect().adjusted( 1.5, 1.5, -1.5, -1.5 ), m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
else painter->drawRect( rect().adjusted( 1.5, 1.5, -1.5, -1.5 ) );

QColor borderColor3( c->isActive() ?
titleBarColor :
c->color( ColorGroup::Inactive, ColorRole::Frame ) );
QPen border_pen3( borderColor3 );
border_pen3.setWidthF( 0.5 );
painter->setPen(border_pen3);
if( s->isAlphaChannelSupported() ) painter->drawRoundedRect(rect().adjusted( 2, 2, -2, -2 ), m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
else painter->drawRect( rect().adjusted( 2, 2, -2, -2 ) );
painter->drawRoundedRect(rect().adjusted( 0, 0, -1, -1 ), m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());

painter->restore();
}
Expand Down Expand Up @@ -826,7 +791,7 @@ namespace Breeze

painter->drawRoundedRect(titleRect, m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());

} else {
} /*else {
painter->setClipRect(titleRect, Qt::IntersectClip);
Expand All @@ -838,7 +803,7 @@ namespace Breeze
m_internalSettings->cornerRadius()),
m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
}
}*/

const QColor outlineColor( this->outlineColor() );
if( !c->isShaded() && outlineColor.isValid() )
Expand Down

0 comments on commit 80d4e41

Please sign in to comment.