Skip to content

Commit

Permalink
Adjust titlebar style for Tools Area and new color scheme
Browse files Browse the repository at this point in the history
In support of https://phabricator.kde.org/T10201.

This is intended to be used with
https://invent.kde.org/plasma/breeze/-/merge_requests/2 (new color
scheme) and https://phabricator.kde.org/D27669 (Tools area appearance)
  • Loading branch information
Pointedstick committed Sep 28, 2020
1 parent 3cb7594 commit 6dcbcb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions kdecoration/breezebutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,11 @@ namespace Breeze
}

auto c = d->client().data();
QColor redColor( c->color( ColorGroup::Warning, ColorRole::Foreground ) );

if( isPressed() ) {

if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground );
if( type() == DecorationButtonType::Close ) return redColor.darker();
else return KColorUtils::mix( d->titleBarColor(), d->fontColor(), 0.3 );

} else if( ( type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove || type() == DecorationButtonType::Shade ) && isChecked() ) {
Expand All @@ -421,11 +423,11 @@ namespace Breeze
if( d->internalSettings()->outlineCloseButton() )
{

return KColorUtils::mix( d->fontColor(), c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter(), m_opacity );
return c->isActive() ? KColorUtils::mix( redColor, redColor.lighter(), m_opacity ) : KColorUtils::mix( redColor.lighter(), redColor, m_opacity );

} else {

QColor color( c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter() );
QColor color( redColor.lighter() );
color.setAlpha( color.alpha()*m_opacity );
return color;

Expand All @@ -441,12 +443,12 @@ namespace Breeze

} else if( isHovered() ) {

if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter();
if( type() == DecorationButtonType::Close ) return c->isActive() ? redColor.lighter() : redColor;
else return d->fontColor();

} else if( type() == DecorationButtonType::Close && d->internalSettings()->outlineCloseButton() ) {

return d->fontColor();
return c->isActive() ? redColor : d->fontColor();

} else {

Expand Down
2 changes: 1 addition & 1 deletion kdecoration/breezesettingsdata.kcfg
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

<!-- size grip -->
<entry name="DrawBackgroundGradient" type = "Bool">
<default>true</default>
<default>false</default>
</entry>

<!-- size grip -->
Expand Down

0 comments on commit 6dcbcb5

Please sign in to comment.