Skip to content

Commit

Permalink
better ring outlines
Browse files Browse the repository at this point in the history
  • Loading branch information
kupiqu committed Nov 21, 2019
1 parent 80d4e41 commit 29fce22
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 33 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 "0.5.2")
set(PROJECT_VERSION "0.5.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 @@
V0.5.3
---------

* Better ring outlines

V0.5.2
---------

Expand Down
80 changes: 48 additions & 32 deletions breezebutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ namespace Breeze
{
const QColor button_color = QColor(252, 87, 83);

QPen button_pen( QColor(223, 71, 68) );
//QPen button_pen( QColor(223, 71, 68) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -250,7 +251,8 @@ namespace Breeze
{
const QColor button_color = QColor(51, 199, 72);

QPen button_pen( QColor(39, 170, 53) );
//QPen button_pen( QColor(39, 170, 53) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -314,7 +316,8 @@ namespace Breeze
{
const QColor button_color = QColor(253, 188, 64);

QPen button_pen( QColor(222, 159, 52) );
//QPen button_pen( QColor(222, 159, 52) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -353,7 +356,8 @@ namespace Breeze
{
const QColor button_color = QColor(125, 209, 200);

QPen button_pen( QColor(108, 179, 174) );
//QPen button_pen( QColor(108, 179, 174) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -393,7 +397,8 @@ namespace Breeze
{
const QColor button_color = QColor(204, 176, 213);

QPen button_pen( QColor(172, 149, 179) );
//QPen button_pen( QColor(172, 149, 179) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -450,7 +455,8 @@ namespace Breeze
{
const QColor button_color = QColor(255, 137, 241);

QPen button_pen( QColor(192, 104, 180) );
//QPen button_pen( QColor(192, 104, 180) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -495,7 +501,8 @@ namespace Breeze
{
const QColor button_color = QColor(135, 206, 249);

QPen button_pen( QColor(118, 178, 218) );
//QPen button_pen( QColor(118, 178, 218) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -566,7 +573,8 @@ namespace Breeze
{
const QColor button_color = QColor(102, 156, 246);

QPen button_pen( QColor(79, 120, 192) );
//QPen button_pen( QColor(79, 120, 192) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -1353,7 +1361,8 @@ namespace Breeze
{
const QColor button_color = QColor(252, 87, 83);

QPen button_pen( QColor(223, 71, 68) );
//QPen button_pen( QColor(223, 71, 68) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -1394,7 +1403,8 @@ namespace Breeze
{
const QColor button_color = QColor(51, 199, 72);

QPen button_pen( QColor(39, 170, 53) );
//QPen button_pen( QColor(39, 170, 53) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -1450,7 +1460,8 @@ namespace Breeze
{
const QColor button_color = QColor(253, 188, 64);

QPen button_pen( QColor(222, 159, 52) );
//QPen button_pen( QColor(222, 159, 52) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -1489,7 +1500,8 @@ namespace Breeze
{
const QColor button_color = QColor(125, 209, 200);

QPen button_pen( QColor(108, 179, 174) );
//QPen button_pen( QColor(108, 179, 174) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -1550,7 +1562,8 @@ namespace Breeze
{
const QColor button_color = QColor(204, 176, 213);

QPen button_pen( QColor(172, 149, 179) );
//QPen button_pen( QColor(172, 149, 179) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -1593,7 +1606,8 @@ namespace Breeze
{
const QColor button_color = QColor(255, 137, 241);

QPen button_pen( QColor(192, 104, 180) );
//QPen button_pen( QColor(192, 104, 180) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -1636,7 +1650,8 @@ namespace Breeze
{
const QColor button_color = QColor(135, 206, 249);

QPen button_pen( QColor(118, 178, 218) );
//QPen button_pen( QColor(118, 178, 218) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -1714,7 +1729,8 @@ namespace Breeze
{
const QColor button_color = QColor(102, 156, 246);

QPen button_pen( QColor(79, 120, 192) );
//QPen button_pen( QColor(79, 120, 192) );
QPen button_pen( button_color.darker( 150 ) );
button_pen.setJoinStyle( Qt::MiterJoin );
button_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

Expand Down Expand Up @@ -1806,7 +1822,7 @@ namespace Breeze

case DecorationButtonType::Close:
{
QColor button_color = QColor( 242, 80, 86 );
QColor button_color = QColor(252, 87, 83);
button_color.setAlpha( button_color.alpha()*m_opacity );
painter->setPen( Qt::NoPen );
painter->setBrush( button_color );
Expand All @@ -1818,7 +1834,7 @@ namespace Breeze
painter->setBrush( Qt::NoBrush );

button_color.setAlpha( 255 );
QColor mycolor = this->mixColors(button_color, symbolColor, m_opacity);
QColor mycolor = this->mixColors(button_color.darker( 100 ), symbolColor, m_opacity);
symbol_pen.setColor(mycolor);
painter->setPen( symbol_pen );
// it's a cross
Expand All @@ -1830,7 +1846,7 @@ namespace Breeze

case DecorationButtonType::Maximize:
{
QColor button_color = QColor(39, 170, 53);
QColor button_color = QColor(51, 199, 72);
button_color.setAlpha( button_color.alpha()*m_opacity );
painter->setPen( Qt::NoPen );
painter->setBrush( button_color );
Expand All @@ -1843,7 +1859,7 @@ namespace Breeze
painter->setPen( Qt::NoPen );

button_color.setAlpha( 255 );
QColor mycolor = this->mixColors(button_color, symbolColor, m_opacity);
QColor mycolor = this->mixColors(button_color.darker( 100 ), symbolColor, m_opacity);

// two triangles
QPainterPath path1, path2;
Expand Down Expand Up @@ -1876,7 +1892,7 @@ namespace Breeze

case DecorationButtonType::Minimize:
{
QColor button_color = QColor(222, 159, 52);
QColor button_color = QColor(253, 188, 64);
button_color.setAlpha( button_color.alpha()*m_opacity );
painter->setPen( Qt::NoPen );
painter->setBrush( button_color );
Expand All @@ -1888,7 +1904,7 @@ namespace Breeze
painter->setBrush( Qt::NoBrush );

button_color.setAlpha( 255 );
QColor mycolor = this->mixColors(button_color, symbolColor, m_opacity);
QColor mycolor = this->mixColors(button_color.darker( 100 ), symbolColor, m_opacity);
symbol_pen.setColor(mycolor);
painter->setPen( symbol_pen );
// it's a horizontal line
Expand All @@ -1899,7 +1915,7 @@ namespace Breeze

case DecorationButtonType::OnAllDesktops:
{
QColor button_color = QColor(108, 179, 174);
QColor button_color = QColor(125, 209, 200);
if ( !isChecked() )
button_color.setAlpha( button_color.alpha()*m_opacity );
painter->setPen( Qt::NoPen );
Expand All @@ -1914,7 +1930,7 @@ namespace Breeze
button_color.setAlpha( 255 );
QColor mycolor = symbolColor;
if ( !isChecked() )
mycolor = this->mixColors(button_color, symbolColor, m_opacity);
mycolor = this->mixColors(button_color.darker( 100 ), symbolColor, m_opacity);
symbol_pen.setColor(mycolor);
// painter->setPen( symbol_pen );
painter->setPen( Qt::NoPen );
Expand All @@ -1926,7 +1942,7 @@ namespace Breeze

case DecorationButtonType::Shade:
{
QColor button_color = QColor(172, 149, 179);
QColor button_color = QColor(204, 176, 213);
button_color.setAlpha( button_color.alpha()*m_opacity );
painter->setPen( Qt::NoPen );
painter->setBrush( button_color );
Expand All @@ -1938,7 +1954,7 @@ namespace Breeze
painter->setBrush( Qt::NoBrush );

button_color.setAlpha( 255 );
QColor mycolor = this->mixColors(button_color, symbolColor, m_opacity);
QColor mycolor = this->mixColors(button_color.darker( 100 ), symbolColor, m_opacity);
symbol_pen.setColor(mycolor);
painter->setPen( symbol_pen );
// it's a triangle with a dash
Expand Down Expand Up @@ -1971,7 +1987,7 @@ namespace Breeze

case DecorationButtonType::KeepBelow:
{
QColor button_color = QColor(192, 104, 180);
QColor button_color = QColor(255, 137, 241);
if ( !isChecked() )
button_color.setAlpha( button_color.alpha()*m_opacity );
painter->setPen( Qt::NoPen );
Expand All @@ -1986,7 +2002,7 @@ namespace Breeze
button_color.setAlpha( 255 );
QColor mycolor = symbolColor;
if ( !isChecked() )
mycolor = this->mixColors(button_color, symbolColor, m_opacity);
mycolor = this->mixColors(button_color.darker (125), symbolColor, m_opacity);
painter->setPen( Qt::NoPen );

// it's a downward pointing triangle
Expand All @@ -2002,7 +2018,7 @@ namespace Breeze

case DecorationButtonType::KeepAbove:
{
QColor button_color = QColor(118, 178, 218);
QColor button_color = QColor(135, 206, 249);
if ( !isChecked() )
button_color.setAlpha( button_color.alpha()*m_opacity );
painter->setPen( Qt::NoPen );
Expand All @@ -2017,7 +2033,7 @@ namespace Breeze
button_color.setAlpha( 255 );
QColor mycolor = symbolColor;
if ( !isChecked() )
mycolor = this->mixColors(button_color, symbolColor, m_opacity);
mycolor = this->mixColors(button_color.darker( 100 ), symbolColor, m_opacity);
painter->setPen( Qt::NoPen );

// it's a upward pointing triangle
Expand Down Expand Up @@ -2068,7 +2084,7 @@ namespace Breeze

case DecorationButtonType::ContextHelp:
{
QColor button_color = QColor(79, 120, 192);
QColor button_color =QColor(102, 156, 246);
button_color.setAlpha( button_color.alpha()*m_opacity );
painter->setPen( Qt::NoPen );
painter->setBrush( button_color );
Expand All @@ -2080,7 +2096,7 @@ namespace Breeze
painter->setBrush( Qt::NoBrush );

button_color.setAlpha( 255 );
QColor mycolor = this->mixColors(button_color, symbolColor, m_opacity);
QColor mycolor = this->mixColors(button_color.darker( 100 ), symbolColor, m_opacity);
symbol_pen.setColor(mycolor);
painter->setPen( symbol_pen );
// it's a question mark
Expand Down

0 comments on commit 29fce22

Please sign in to comment.