Skip to content

Commit

Permalink
fixes issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
kupiqu committed Nov 26, 2018
1 parent 4c578ce commit b3cb7b4
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 29 deletions.
37 changes: 15 additions & 22 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
V0.2
---------

* Added settings option for decoration style:
- distinct decoration for active and inactive windows (default).
- use the active decoration also for inactive windows.
- use the inactive decoration also for the active window.

V0.1.2
---------

Fixed version numbering
* Fixed version numbering.

V0.1.1
---------

* Symbol properties (line colors and width) now apply to the menu button
* Symbol properties (line colors and width) now apply to the menu button.

V0.1
---------
* First version of the fork (arguably more minimalistic and informative behavior):
- non-gray colors do not change.
- active window: show symbol on hovering.
- inactive window: always show symbol, show ring color on hovering.
- application menu button is considered special and stays as in vanilla breeze.
- no more option for non macOS-like buttons as it doesn't apply anymore.

V5.14
---------
* Upgraded for Breeze 5.14 with its new shadows.
* Applied the upstream patch https://phabricator.kde.org/D16596.

V5.13
---------
* First version, made out of Breeze 5.13 and BreezeBlurred with new options.
* Set the font style name for KDE to render it correctly. I don't know why KDE needs that while LXQt doesn't.
* Added an option for not using macOS-like buttons.
* Added flatness to the exception list.
* Made inactive macOS-like buttons gray.
* Added a setting for button spacing.
* Added opacity override to the exception dialog.
- non-gray colors do not change.
- active window: show symbol on hovering.
- inactive window: always show symbol, show ring color on hovering.
- application menu button is considered special and stays as in vanilla breeze.
- no more option for non macOS-like buttons as it doesn't apply anymore.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ SierraBreezeEnhanced is a fork of BreezeEnhanced decoration with the following c
* inactive window: always show symbol, show ring color on hovering.
* application menu button is considered special and stays as in vanilla breeze.
* no more option for non macOS-like buttons as it doesn't apply anymore.
* added, however, an option to either choose active vs. inactive style (default), always active style (also for non-active windows), or inactive style (also for the active window).

## Credits:

Expand Down
19 changes: 15 additions & 4 deletions breezebutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ namespace Breeze

auto d = qobject_cast<Decoration*>( decoration() );
bool isInactive(d && !d->client().data()->isActive());
bool invertSymbolColors = false;

bool useAlwaysActiveStyle( d && d->internalSettings()->decorationStyle() == 1 );
bool useAlwaysInactiveStyle( d && d->internalSettings()->decorationStyle() == 2 );
if ( useAlwaysActiveStyle )
isInactive = false;
else if ( useAlwaysInactiveStyle ) {
isInactive = true;
invertSymbolColors = true;
}

const QColor inactiveCol = "transparent"; // no color

// render mark
Expand All @@ -179,7 +190,7 @@ namespace Breeze
pen.setJoinStyle( Qt::MiterJoin );
pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );

const QColor hover_hint_color( this->autoColor() );
const QColor hover_hint_color( this->autoColor( invertSymbolColors ) );
QPen hint_pen(hover_hint_color);
hint_pen.setJoinStyle( Qt::MiterJoin );
hint_pen.setWidthF( 1.7*qMax((qreal)1.0, 20/width ) );
Expand Down Expand Up @@ -481,7 +492,7 @@ namespace Breeze

case DecorationButtonType::ApplicationMenu:
{
if ( isInactive )
if ( isInactive || ( useAlwaysActiveStyle && d && !d->client().data()->isActive() ) )
{
painter->setPen( hint_pen );
}
Expand Down Expand Up @@ -545,11 +556,11 @@ namespace Breeze
}

//__________________________________________________________________
QColor Button::autoColor() const
QColor Button::autoColor( bool invertSymbolColors ) const
{
auto d = qobject_cast<Decoration*>( decoration() );
QColor col;
if (d && !d->client().data()->isActive())
if ( ( d && !d->client().data()->isActive() ) || invertSymbolColors )
{
if (qGray(d->titleBarColor().rgb()) > 100)
col = QColor(34, 45, 50, 200);
Expand Down
2 changes: 1 addition & 1 deletion breezebutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ namespace Breeze
//@{
QColor foregroundColor(const QColor& inactiveCol) const;
QColor backgroundColor() const;
QColor autoColor() const;
QColor autoColor( bool ) const;
//@}

Flag m_flag = FlagNone;
Expand Down
10 changes: 10 additions & 0 deletions breezesettingsdata.kcfg
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@
<default>false</default>
</entry>

<!-- decoration style -->
<entry name="DecorationStyle" type="Enum">
<choices>
<choice name="ActiveVsInactiveStyle" />
<choice name="ActiveStyle" />
<choice name="InactiveStyle" />
</choices>
<default>ActiveVsInactiveStyle</default>
</entry>

<entry name="BackgroundOpacity" type = "Int">
<default>100</default>
</entry>
Expand Down
7 changes: 6 additions & 1 deletion config/breezeconfigwidget.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// breezeconfigurationui.cpp
// -------------------
//
Expand Down Expand Up @@ -52,6 +52,7 @@ namespace Breeze
connect( m_ui.drawBorderOnMaximizedWindows, SIGNAL(clicked()), SLOT(updateChanged()) );
connect( m_ui.drawSizeGrip, SIGNAL(clicked()), SLOT(updateChanged()) );
connect( m_ui.drawBackgroundGradient, SIGNAL(clicked()), SLOT(updateChanged()) );
connect( m_ui.decorationStyle, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( m_ui.opacitySpinBox, QOverload<int>::of(&QSpinBox::valueChanged), [=](int /*i*/){updateChanged();} );
connect( m_ui.gradientSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), [=](int /*i*/){updateChanged();} );

Expand Down Expand Up @@ -91,6 +92,7 @@ namespace Breeze
m_ui.drawBackgroundGradient->setChecked( m_internalSettings->drawBackgroundGradient() );
m_ui.animationsEnabled->setChecked( m_internalSettings->animationsEnabled() );
m_ui.animationsDuration->setValue( m_internalSettings->animationsDuration() );
m_ui.decorationStyle->setCurrentIndex ( m_internalSettings->decorationStyle() );
m_ui.opacitySpinBox->setValue( m_internalSettings->backgroundOpacity() );
m_ui.gradientSpinBox->setValue( m_internalSettings->backgroundGradientIntensity() );

Expand Down Expand Up @@ -135,6 +137,7 @@ namespace Breeze
m_internalSettings->setDrawBackgroundGradient( m_ui.drawBackgroundGradient->isChecked() );
m_internalSettings->setAnimationsEnabled( m_ui.animationsEnabled->isChecked() );
m_internalSettings->setAnimationsDuration( m_ui.animationsDuration->value() );
m_internalSettings->setDecorationStyle( m_ui.decorationStyle->currentIndex() );
m_internalSettings->setBackgroundOpacity(m_ui.opacitySpinBox->value());
m_internalSettings->setBackgroundGradientIntensity(m_ui.gradientSpinBox->value());

Expand Down Expand Up @@ -190,6 +193,7 @@ namespace Breeze
m_ui.drawBackgroundGradient->setChecked( m_internalSettings->drawBackgroundGradient() );
m_ui.animationsEnabled->setChecked( m_internalSettings->animationsEnabled() );
m_ui.animationsDuration->setValue( m_internalSettings->animationsDuration() );
m_ui.decorationStyle->setCurrentIndex( m_internalSettings->decorationStyle() );
m_ui.opacitySpinBox->setValue( m_internalSettings->backgroundOpacity() );
m_ui.gradientSpinBox->setValue( m_internalSettings->backgroundGradientIntensity() );

Expand Down Expand Up @@ -222,6 +226,7 @@ namespace Breeze
else if( m_ui.drawBorderOnMaximizedWindows->isChecked() != m_internalSettings->drawBorderOnMaximizedWindows() ) modified = true;
else if( m_ui.drawSizeGrip->isChecked() != m_internalSettings->drawSizeGrip() ) modified = true;
else if( m_ui.drawBackgroundGradient->isChecked() != m_internalSettings->drawBackgroundGradient() ) modified = true;
else if( m_ui.decorationStyle->currentIndex() != m_internalSettings->decorationStyle() ) modified = true;
else if( m_ui.opacitySpinBox->value() != m_internalSettings->backgroundOpacity() ) modified = true;
else if( m_ui.gradientSpinBox->value() != m_internalSettings->backgroundGradientIntensity() ) modified = true;

Expand Down
47 changes: 46 additions & 1 deletion config/ui/breezeconfigurationui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,52 @@
</property>
</widget>
</item>
<item row="7" column="0" colspan="3">
<item row="7" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>D&amp;ecoration style:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>decorationStyle</cstring>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="decorationStyle">
<item>
<property name="text">
<string>Active vs. Inactive</string>
</property>
</item>
<item>
<property name="text">
<string>Always Active</string>
</property>
</item>
<item>
<property name="text">
<string>Always Inactive</string>
</property>
</item>
</widget>
</item>
<item row="7" column="2">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0,0,1">
<item row="0" column="0">
<widget class="QLabel" name="label_6">
Expand Down

0 comments on commit b3cb7b4

Please sign in to comment.