Skip to content

Commit

Permalink
Fix #108
Browse files Browse the repository at this point in the history
  • Loading branch information
sardid committed Aug 31, 2022
1 parent e32e43e commit ecca4d0
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions breezedecoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,20 +945,22 @@ namespace Breeze
painter->setBrush( titleBarColor );

auto s = settings();
if( !s->isAlphaChannelSupported() )
painter->drawRect(titleRect);
else if ( !hasBorders() ) {
painter->setClipRect(titleRect, Qt::IntersectClip);
// the rect is made a little bit larger to be able to clip away the rounded corners at the bottom and sides
painter->drawRoundedRect(titleRect.adjusted(
isLeftEdge() ? -m_internalSettings->cornerRadius():0,
isTopEdge() ? -m_internalSettings->cornerRadius():0,
isRightEdge() ? m_internalSettings->cornerRadius():0,
m_internalSettings->cornerRadius()),
m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
}
else
painter->drawRoundedRect(titleRect, m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
// // The following conditional creates a color dissonance when opacity is active between the titlebar and the borders.
// // I don't think it's needed anyway since version 1.1.0, but keeping this comment here for the case, this needs to be reverted.
// if( !s->isAlphaChannelSupported() )
// painter->drawRect(titleRect);
// else if ( !hasBorders() ) {
// painter->setClipRect(titleRect, Qt::IntersectClip);
// // the rect is made a little bit larger to be able to clip away the rounded corners at the bottom and sides
// painter->drawRoundedRect(titleRect.adjusted(
// isLeftEdge() ? -m_internalSettings->cornerRadius():0,
// isTopEdge() ? -m_internalSettings->cornerRadius():0,
// isRightEdge() ? m_internalSettings->cornerRadius():0,
// m_internalSettings->cornerRadius()),
// m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
// }
// else
// painter->drawRoundedRect(titleRect, m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());

if( !c->isShaded() && !hideTitleBar() && outlineColor.isValid() )
{
Expand Down

0 comments on commit ecca4d0

Please sign in to comment.