diff --git a/kdecoration/breezedecoration.cpp b/kdecoration/breezedecoration.cpp index 62888e24..97a1f1b2 100644 --- a/kdecoration/breezedecoration.cpp +++ b/kdecoration/breezedecoration.cpp @@ -106,14 +106,20 @@ namespace Breeze { auto c = client().data(); - if( hideTitleBar() ) return c->color( ColorGroup::Inactive, ColorRole::TitleBar ); - else if( m_animation->state() == QPropertyAnimation::Running ) - { - return KColorUtils::mix( - c->color( ColorGroup::Inactive, ColorRole::TitleBar ), - c->color( ColorGroup::Active, ColorRole::TitleBar ), - m_opacity ); - } else return c->color( c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::TitleBar ); + // Always return the title bar color regardless of wheter or + // not the title bar is visible or not. + + // if( hideTitleBar() ) return c->color( ColorGroup::Inactive, ColorRole::TitleBar ); + //else + // if( m_animation->state() == QPropertyAnimation::Running ) + // { + // return KColorUtils::mix( + // c->color( ColorGroup::Inactive, ColorRole::TitleBar ), + // c->color( ColorGroup::Active, ColorRole::TitleBar ), + // m_opacity ); + // } + // else + return c->color( c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::TitleBar ); // } @@ -238,8 +244,11 @@ namespace Breeze void Decoration::updateSizeGripVisibility() { auto c = client().data(); + // I am stealing the sizeGrip to indicate that the window is + // active, so it should be visible provided that the client is + // active. if( m_sizeGrip ) - { m_sizeGrip->setVisible( c->isResizeable() && !isMaximized() && !c->isShaded() ); } + { m_sizeGrip->setVisible( c->isActive() && !c->isShaded() ); } } //________________________________________________________________ @@ -296,7 +305,7 @@ namespace Breeze createShadow(); // size grip - if( hasNoBorders() && m_internalSettings->drawSizeGrip() ) createSizeGrip(); + if( m_internalSettings->drawSizeGrip() ) createSizeGrip(); else deleteSizeGrip(); } @@ -453,6 +462,17 @@ namespace Breeze // // Go sharper; no rounded edges painter->drawRect( rect() ); + if (c->isActive()) { + painter->setPen( c->color( ColorGroup::Active, ColorRole::TitleBar ) ); + QPointF p=rect().bottomRight()+QPointF(0.5, 0.5); + // Unfortunately SizeGrip::GripSize is private + const int sizeGripSize = 18; //SizeGrip::GripSize; + QPointF q=p-QPoint(0, sizeGripSize); + QPointF r=p-QPoint(sizeGripSize, 0); + painter->drawLine( p, q ); + painter->drawLine( p, r ); + } + painter->restore(); } @@ -746,6 +766,7 @@ namespace Breeze connect( c, &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateSizeGripVisibility ); connect( c, &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateSizeGripVisibility ); connect( c, &KDecoration2::DecoratedClient::resizeableChanged, this, &Decoration::updateSizeGripVisibility ); + connect( c, &KDecoration2::DecoratedClient::activeChanged, this, &Decoration::updateSizeGripVisibility ); } #endif diff --git a/kdecoration/breezesizegrip.h b/kdecoration/breezesizegrip.h index b240d90b..4752f7a8 100644 --- a/kdecoration/breezesizegrip.h +++ b/kdecoration/breezesizegrip.h @@ -81,7 +81,7 @@ namespace Breeze //* grip size enum { Offset = 0, - GripSize = 14 + GripSize = 18 }; //* decoration