|
|
|
@ -106,14 +106,17 @@ namespace Breeze |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
auto c = client().data(); |
|
|
|
auto c = client().data(); |
|
|
|
if( hideTitleBar() ) return c->color( ColorGroup::Inactive, ColorRole::TitleBar ); |
|
|
|
// if( hideTitleBar() ) return c->color( ColorGroup::Inactive, ColorRole::TitleBar );
|
|
|
|
else if( m_animation->state() == QPropertyAnimation::Running ) |
|
|
|
//else
|
|
|
|
{ |
|
|
|
// if( m_animation->state() == QPropertyAnimation::Running )
|
|
|
|
return KColorUtils::mix( |
|
|
|
// {
|
|
|
|
c->color( ColorGroup::Inactive, ColorRole::TitleBar ), |
|
|
|
// return KColorUtils::mix(
|
|
|
|
c->color( ColorGroup::Active, ColorRole::TitleBar ), |
|
|
|
// c->color( ColorGroup::Inactive, ColorRole::TitleBar ),
|
|
|
|
m_opacity ); |
|
|
|
// c->color( ColorGroup::Active, ColorRole::TitleBar ),
|
|
|
|
} else return c->color( c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::TitleBar ); |
|
|
|
// m_opacity );
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
return c->color( c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::TitleBar ); //
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -239,20 +242,20 @@ namespace Breeze |
|
|
|
{ |
|
|
|
{ |
|
|
|
auto c = client().data(); |
|
|
|
auto c = client().data(); |
|
|
|
if( m_sizeGrip ) |
|
|
|
if( m_sizeGrip ) |
|
|
|
{ m_sizeGrip->setVisible( c->isResizeable() && !isMaximized() && !c->isShaded() ); } |
|
|
|
{ m_sizeGrip->setVisible( c->isActive() && !c->isShaded() ); } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//________________________________________________________________
|
|
|
|
//________________________________________________________________
|
|
|
|
int Decoration::borderSize(bool bottom) const |
|
|
|
int Decoration::borderSize(bool bottom) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
const int baseSize = settings()->smallSpacing(); |
|
|
|
const int baseSize = settings()->smallSpacing()*0.50; |
|
|
|
if( m_internalSettings && (m_internalSettings->mask() & BorderSize ) ) |
|
|
|
if( m_internalSettings && (m_internalSettings->mask() & BorderSize ) ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (m_internalSettings->borderSize()) { |
|
|
|
switch (m_internalSettings->borderSize()) { |
|
|
|
case InternalSettings::BorderNone: return 0; |
|
|
|
case InternalSettings::BorderNone: return 0; |
|
|
|
case InternalSettings::BorderNoSides: return bottom ? qMax(4, baseSize) : 0; |
|
|
|
case InternalSettings::BorderNoSides: return bottom ? baseSize : 0; |
|
|
|
default: |
|
|
|
default: |
|
|
|
case InternalSettings::BorderTiny: return bottom ? qMax(4, baseSize) : baseSize; |
|
|
|
case InternalSettings::BorderTiny: return baseSize; |
|
|
|
case InternalSettings::BorderNormal: return baseSize*2; |
|
|
|
case InternalSettings::BorderNormal: return baseSize*2; |
|
|
|
case InternalSettings::BorderLarge: return baseSize*3; |
|
|
|
case InternalSettings::BorderLarge: return baseSize*3; |
|
|
|
case InternalSettings::BorderVeryLarge: return baseSize*4; |
|
|
|
case InternalSettings::BorderVeryLarge: return baseSize*4; |
|
|
|
@ -265,9 +268,9 @@ namespace Breeze |
|
|
|
|
|
|
|
|
|
|
|
switch (settings()->borderSize()) { |
|
|
|
switch (settings()->borderSize()) { |
|
|
|
case KDecoration2::BorderSize::None: return 0; |
|
|
|
case KDecoration2::BorderSize::None: return 0; |
|
|
|
case KDecoration2::BorderSize::NoSides: return bottom ? qMax(4, baseSize) : 0; |
|
|
|
case KDecoration2::BorderSize::NoSides: return bottom ? baseSize : 0; |
|
|
|
default: |
|
|
|
default: |
|
|
|
case KDecoration2::BorderSize::Tiny: return bottom ? qMax(4, baseSize) : baseSize; |
|
|
|
case KDecoration2::BorderSize::Tiny: return baseSize; |
|
|
|
case KDecoration2::BorderSize::Normal: return baseSize*2; |
|
|
|
case KDecoration2::BorderSize::Normal: return baseSize*2; |
|
|
|
case KDecoration2::BorderSize::Large: return baseSize*3; |
|
|
|
case KDecoration2::BorderSize::Large: return baseSize*3; |
|
|
|
case KDecoration2::BorderSize::VeryLarge: return baseSize*4; |
|
|
|
case KDecoration2::BorderSize::VeryLarge: return baseSize*4; |
|
|
|
@ -296,7 +299,7 @@ namespace Breeze |
|
|
|
createShadow(); |
|
|
|
createShadow(); |
|
|
|
|
|
|
|
|
|
|
|
// size grip
|
|
|
|
// size grip
|
|
|
|
if( hasNoBorders() && m_internalSettings->drawSizeGrip() ) createSizeGrip(); |
|
|
|
if( m_internalSettings->drawSizeGrip() ) createSizeGrip(); |
|
|
|
else deleteSizeGrip(); |
|
|
|
else deleteSizeGrip(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@ -447,8 +450,21 @@ namespace Breeze |
|
|
|
// clip away the top part
|
|
|
|
// 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); |
|
|
|
|
|
|
|
|
|
|
|
if( s->isAlphaChannelSupported() ) painter->drawRoundedRect(rect(), Metrics::Frame_FrameRadius, Metrics::Frame_FrameRadius); |
|
|
|
//if( s->isAlphaChannelSupported() ) painter->drawRoundedRect(rect(), Metrics::Frame_FrameRadius/2, Metrics::Frame_FrameRadius/2);
|
|
|
|
else painter->drawRect( rect() ); |
|
|
|
//else
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // 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); |
|
|
|
|
|
|
|
const int sizeGripSize = 18; //this sucks
|
|
|
|
|
|
|
|
QPointF q=p-QPoint(0, sizeGripSize); |
|
|
|
|
|
|
|
QPointF r=p-QPoint(sizeGripSize, 0); |
|
|
|
|
|
|
|
painter->drawLine( p, q ); |
|
|
|
|
|
|
|
painter->drawLine( p, r ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
painter->restore(); |
|
|
|
painter->restore(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -460,8 +476,8 @@ namespace Breeze |
|
|
|
painter->save(); |
|
|
|
painter->save(); |
|
|
|
painter->setRenderHint(QPainter::Antialiasing, false); |
|
|
|
painter->setRenderHint(QPainter::Antialiasing, false); |
|
|
|
painter->setBrush( Qt::NoBrush ); |
|
|
|
painter->setBrush( Qt::NoBrush ); |
|
|
|
painter->setPen( c->isActive() ? |
|
|
|
painter->setPen( //c->isActive() ?
|
|
|
|
c->color( ColorGroup::Active, ColorRole::TitleBar ): |
|
|
|
//c->color( ColorGroup::Active, ColorRole::TitleBar ):
|
|
|
|
c->color( ColorGroup::Inactive, ColorRole::Foreground ) ); |
|
|
|
c->color( ColorGroup::Inactive, ColorRole::Foreground ) ); |
|
|
|
|
|
|
|
|
|
|
|
painter->drawRect( rect().adjusted( 0, 0, -1, -1 ) ); |
|
|
|
painter->drawRect( rect().adjusted( 0, 0, -1, -1 ) ); |
|
|
|
@ -650,7 +666,7 @@ namespace Breeze |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// offset
|
|
|
|
// offset
|
|
|
|
int shadowOffset = (g_shadowSizeEnum == InternalSettings::ShadowNone) ? 0 : qMax( 6*shadowSize/16, Metrics::Shadow_Overlap*2 ); |
|
|
|
const int shadowOffset = 0; //qMax( 6*g_shadowSize/16, Metrics::Shadow_Overlap*2 );
|
|
|
|
|
|
|
|
|
|
|
|
// create image
|
|
|
|
// create image
|
|
|
|
QImage image(2*shadowSize, 2*shadowSize, QImage::Format_ARGB32_Premultiplied); |
|
|
|
QImage image(2*shadowSize, 2*shadowSize, QImage::Format_ARGB32_Premultiplied); |
|
|
|
@ -690,9 +706,9 @@ namespace Breeze |
|
|
|
|
|
|
|
|
|
|
|
// contrast pixel
|
|
|
|
// contrast pixel
|
|
|
|
QRectF innerRect = QRectF( |
|
|
|
QRectF innerRect = QRectF( |
|
|
|
|
|
|
|
|
|
|
|
shadowSize - Metrics::Shadow_Overlap, shadowSize - shadowOffset - Metrics::Shadow_Overlap, |
|
|
|
shadowSize - Metrics::Shadow_Overlap, shadowSize - shadowOffset - Metrics::Shadow_Overlap, |
|
|
|
2*Metrics::Shadow_Overlap, shadowOffset + 2*Metrics::Shadow_Overlap ); |
|
|
|
2*Metrics::Shadow_Overlap, shadowOffset + 2*Metrics::Shadow_Overlap ); |
|
|
|
|
|
|
|
|
|
|
|
painter.setPen( gradientStopColor( g_shadowColor, (g_shadowSizeEnum == InternalSettings::ShadowNone) ? g_shadowStrength:(g_shadowStrength*0.5) ) ); |
|
|
|
painter.setPen( gradientStopColor( g_shadowColor, (g_shadowSizeEnum == InternalSettings::ShadowNone) ? g_shadowStrength:(g_shadowStrength*0.5) ) ); |
|
|
|
painter.setBrush( Qt::NoBrush ); |
|
|
|
painter.setBrush( Qt::NoBrush ); |
|
|
|
painter.drawRoundedRect( innerRect, -0.5 + Metrics::Frame_FrameRadius, -0.5 + Metrics::Frame_FrameRadius ); |
|
|
|
painter.drawRoundedRect( innerRect, -0.5 + Metrics::Frame_FrameRadius, -0.5 + Metrics::Frame_FrameRadius ); |
|
|
|
@ -743,6 +759,7 @@ namespace Breeze |
|
|
|
connect( c, &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateSizeGripVisibility ); |
|
|
|
connect( c, &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateSizeGripVisibility ); |
|
|
|
connect( c, &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateSizeGripVisibility ); |
|
|
|
connect( c, &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateSizeGripVisibility ); |
|
|
|
connect( c, &KDecoration2::DecoratedClient::resizeableChanged, this, &Decoration::updateSizeGripVisibility ); |
|
|
|
connect( c, &KDecoration2::DecoratedClient::resizeableChanged, this, &Decoration::updateSizeGripVisibility ); |
|
|
|
|
|
|
|
connect( c, &KDecoration2::DecoratedClient::activeChanged, this, &Decoration::updateSizeGripVisibility ); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|