Skip to content

Commit

Permalink
Added border lines (fixes issue 12)
Browse files Browse the repository at this point in the history
  • Loading branch information
kupiqu committed Nov 20, 2019
1 parent 776a382 commit 34f9acc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ V0.5.0
---------

* Arguably better switch between light and dark colors
* Added border lines (Not done yet - wip to fix issue 12)
* Added border lines (fixes issue 12)
* Added outline to filled rings (fixes issue 23)
* Added new Symbol Style Minimal (monocolor; fixes issue 28)
* Some minor improvements to Gnome Style
Expand Down
49 changes: 41 additions & 8 deletions breezedecoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,26 +700,59 @@ namespace Breeze
painter->setBrush( m_windowColor );

// clip away the top part
if( !hideTitleBar() ) painter->setClipRect(0, borderTop(), size().width(), size().height() - borderTop(), Qt::IntersectClip);

if( s->isAlphaChannelSupported() ) painter->drawRoundedRect(rect(), m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
else painter->drawRect( rect() );
// if( !hideTitleBar() ) painter->setClipRect(0, borderTop(), size().width(), size().height() - borderTop(), Qt::IntersectClip);

QPen border_pen1( QColor(81, 102, 107) );
border_pen1.setWidthF( 2 );
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() ?
c->color( ColorGroup::Active, ColorRole::TitleBar ):
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->restore();
}

if( !hideTitleBar() ) paintTitleBar(painter, repaintRegion);

if( hasBorders() && !s->isAlphaChannelSupported() )
if ( hasBorders() ) // && !s->isAlphaChannelSupported() )
{
painter->save();
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setBrush( Qt::NoBrush );
painter->setPen( c->isActive() ?

QPen border_pen1( QColor(81, 102, 107) );
border_pen1.setWidthF( 2 );
painter->setPen(border_pen1);
painter->drawRect( rect().adjusted( 1, 1, -1, -1 ) );

QPen border_pen2( QColor(255, 255, 0) );
border_pen2.setWidthF( 0.5 );
painter->setPen(border_pen2);
painter->drawRect( rect().adjusted( 1.5, 1.5, -1.5, -1.5 ) );

QColor borderColor3( c->isActive() ?
c->color( ColorGroup::Active, ColorRole::TitleBar ):
c->color( ColorGroup::Inactive, ColorRole::Foreground ) );
c->color( ColorGroup::Inactive, ColorRole::Frame ) );
QPen border_pen3( borderColor3 );
border_pen3.setWidthF( 0.5 );
painter->setPen(border_pen3);
painter->drawRect( rect().adjusted( 2, 2, -2, -2 ) );

painter->drawRect( rect().adjusted( 0, 0, -1, -1 ) );
painter->restore();
}

Expand Down

0 comments on commit 34f9acc

Please sign in to comment.