From d43ea4c82426e3ce62b976ef48f1eff7b5642163 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Fri, 16 Jan 2015 14:49:51 +0100 Subject: [PATCH] Do not draw separator in active windows if titlebar color match window background color --- kdecoration/breezedecoration.cpp | 10 ++++++---- kdecoration/breezedecoration.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/kdecoration/breezedecoration.cpp b/kdecoration/breezedecoration.cpp index 9f7faf1e..6da9b893 100644 --- a/kdecoration/breezedecoration.cpp +++ b/kdecoration/breezedecoration.cpp @@ -68,6 +68,7 @@ namespace Breeze , m_animation( new QPropertyAnimation( this ) ) { g_sDecoCount++; + m_useSeparator = (m_colorSettings.palette().color( QPalette::Window ) != m_colorSettings.activeTitleBar() ); } //________________________________________________________________ @@ -104,13 +105,13 @@ namespace Breeze //________________________________________________________________ QColor Decoration::outlineColor() const { - + if( !m_useSeparator ) return QColor(); if( m_animation->state() == QPropertyAnimation::Running ) { - QColor color( client().data()->palette().color( QPalette::Highlight ) ); + QColor color( m_colorSettings.palette().color( QPalette::Highlight ) ); color.setAlpha( color.alpha()*m_opacity ); return color; - } else if( client().data()->isActive() ) return client().data()->palette().color( QPalette::Highlight ); + } else if( client().data()->isActive() ) return m_colorSettings.palette().color( QPalette::Highlight ); else return QColor(); } @@ -164,6 +165,7 @@ namespace Breeze connect(client().data(), &KDecoration2::DecoratedClient::paletteChanged, this, [this]() { m_colorSettings.update(client().data()->palette()); + m_useSeparator = (m_colorSettings.palette().color( QPalette::Window ) != m_colorSettings.activeTitleBar() ); update(); } ); @@ -523,7 +525,7 @@ namespace Breeze return color; }; - const QColor shadowColor( client().data()->palette().color( QPalette::Shadow ) ); + const QColor shadowColor( m_colorSettings.palette().color( QPalette::Shadow ) ); QRadialGradient radialGradient( Metrics::Shadow_Size, Metrics::Shadow_Size, Metrics::Shadow_Size); radialGradient.setColorAt(0.0, gradientStopColor(shadowColor, 0.35)); diff --git a/kdecoration/breezedecoration.h b/kdecoration/breezedecoration.h index ebaffa54..692d7adf 100644 --- a/kdecoration/breezedecoration.h +++ b/kdecoration/breezedecoration.h @@ -133,6 +133,7 @@ namespace Breeze ColorSettings m_colorSettings; InternalSettingsPtr m_internalSettings; + bool m_useSeparator = true; QList m_buttons; KDecoration2::DecorationButtonGroup *m_leftButtons = nullptr;