Skip to content

Commit

Permalink
V1.3.3 restore gradients
Browse files Browse the repository at this point in the history
  • Loading branch information
sardid committed Mar 21, 2023
1 parent a2bb374 commit b65a4a6
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

project(sierrabreezeenhanced)
set(PROJECT_VERSION "1.3.2")
set(PROJECT_VERSION "1.3.3")
set(PROJECT_VERSION_MAJOR 0)

cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
Expand Down
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
V1.3.3
---------

* Restore gradients

V1.3.2
---------

Expand Down
62 changes: 43 additions & 19 deletions breezedecoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,13 @@ namespace Breeze
0.5*s->smallSpacing()*(m_internalSettings->cornerRadius() + 0.5));

// Draw outline.
painter.setPen(withOpacity(g_shadowColor, 0.2 * strength));
painter.setBrush(Qt::NoBrush);
painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
painter.drawRoundedRect(
innerRect,
0.5*s->smallSpacing()*(m_internalSettings->cornerRadius() - 0.5),
0.5*s->smallSpacing()*(m_internalSettings->cornerRadius() - 0.5));
// painter.setPen(withOpacity(g_shadowColor, 0.2 * strength));
// painter.setBrush(Qt::NoBrush);
// painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
// painter.drawRoundedRect(
// innerRect,
// 0.5*s->smallSpacing()*(m_internalSettings->cornerRadius() - 0.5),
// 0.5*s->smallSpacing()*(m_internalSettings->cornerRadius() - 0.5));

painter.end();

Expand Down Expand Up @@ -609,13 +609,13 @@ namespace Breeze
0.5*s->smallSpacing()*(m_internalSettings->cornerRadius() + 0.5));

// Draw outline.
painter.setPen(withOpacity(g_shadowColorInactiveWindows, 0.2 * strength));
painter.setBrush(Qt::NoBrush);
painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
painter.drawRoundedRect(
innerRect,
0.5*s->smallSpacing()*(m_internalSettings->cornerRadius() - 0.5),
0.5*s->smallSpacing()*(m_internalSettings->cornerRadius() - 0.5));
// painter.setPen(withOpacity(g_shadowColorInactiveWindows, 0.2 * strength));
// painter.setBrush(Qt::NoBrush);
// painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
// painter.drawRoundedRect(
// innerRect,
// 0.5*s->smallSpacing()*(m_internalSettings->cornerRadius() - 0.5),
// 0.5*s->smallSpacing()*(m_internalSettings->cornerRadius() - 0.5));

painter.end();

Expand Down Expand Up @@ -896,14 +896,21 @@ namespace Breeze
painter->setBrush( titleBarColor );

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

// When no borders set, outline will be drawn by shader
QPen border_pen1;
if(borderSize() == 0)
border_pen1 = QPen( titleBarColor );
else
border_pen1 = QPen( titleBarColor.darker( 125 ) );

QPen border_pen1( titleBarColor.darker( 125 ) );
painter->setPen(border_pen1);
if( s->isAlphaChannelSupported() )
if( s->isAlphaChannelSupported() ) {
painter->drawRoundedRect(rect(), 0.5*s->smallSpacing()*m_internalSettings->cornerRadius(), 0.5*s->smallSpacing()*m_internalSettings->cornerRadius());
else
} else {
painter->drawRect( rect() );
}

painter->restore();
}
Expand Down Expand Up @@ -956,6 +963,24 @@ namespace Breeze
else
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
QRect adjustetTitleRect = titleRect.adjusted(
isLeftEdge() ? -m_internalSettings->cornerRadius():0,
isTopEdge() ? -m_internalSettings->cornerRadius():0,
isRightEdge() ? m_internalSettings->cornerRadius():0,
m_internalSettings->cornerRadius());

painter->drawRoundedRect(adjustetTitleRect, m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
}
else {
painter->drawRoundedRect(titleRect, m_internalSettings->cornerRadius(), m_internalSettings->cornerRadius());
}

if( !c->isShaded() && !hideTitleBar() && outlineColor.isValid() )
{
// outline
Expand All @@ -969,7 +994,6 @@ namespace Breeze

painter->restore();

auto s = settings();
if( !hideTitleBar() ) {
// draw all buttons
m_leftButtons->paint(painter, repaintRegion);
Expand Down

0 comments on commit b65a4a6

Please sign in to comment.