From 0d291b3f09cb44fbe99fad3eb292a0be0866fc3d Mon Sep 17 00:00:00 2001 From: Emirald Mateli Date: Sun, 29 Oct 2017 09:04:08 -0600 Subject: [PATCH] Added setting to toggle drawing of title bar separator Summary: Adds a new settings on Breeze theme which allows the user to turn off the title bar separator drawn {F5437291} {F5437290} Rationale behind this patch: From what I understand, the separator is seen as a design choice so I won't argue over it, not to mention something like this is entirely subjective. However, I personally dislike the separator, especially on darker windows. The only way to get rid of it is to either make a custom color scheme for each application so the colors match exactly or run a patched version of breeze (which is what I do). Before using my Breeze patched version I searched on the net on how to remove it, which led me to several threads with other users wanting to toggle it off which is why I make this patch public. Below are screenshots where the separator is especially noticeable and in my non-design-expert opinion kind of distracting. I think it's a positive addition. Looking forward to your opinions on the matter. {F5437332} {F5437331} {F5437330} {F5437329} Test Plan: 1. Use default breeze theme 2. Check the enable/disable the new setting Reviewers: #breeze, #vdg, ngraham, hpereiradacosta Reviewed By: ngraham Subscribers: andreaska, abetts, jensreuterberg, broulik, rpelorosso, #breeze, ngraham, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D8362 --- kdecoration/breezedecoration.cpp | 2 +- kdecoration/breezesettingsdata.kcfg | 4 ++++ kdecoration/config/breezeconfigwidget.cpp | 5 +++++ kdecoration/config/ui/breezeconfigurationui.ui | 10 +++++++++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/kdecoration/breezedecoration.cpp b/kdecoration/breezedecoration.cpp index e6745658..1b808f1d 100644 --- a/kdecoration/breezedecoration.cpp +++ b/kdecoration/breezedecoration.cpp @@ -122,7 +122,7 @@ namespace Breeze { auto c( client().data() ); - if( !m_useSeparator ) return QColor(); + if(! ( m_internalSettings->drawTitleBarSeparator() && m_useSeparator ) ) return QColor(); if( m_animation->state() == QPropertyAnimation::Running ) { QColor color( c->palette().color( QPalette::Highlight ) ); diff --git a/kdecoration/breezesettingsdata.kcfg b/kdecoration/breezesettingsdata.kcfg index 1bdc53cb..7f2bed74 100644 --- a/kdecoration/breezesettingsdata.kcfg +++ b/kdecoration/breezesettingsdata.kcfg @@ -80,6 +80,10 @@ false + + true + + true diff --git a/kdecoration/config/breezeconfigwidget.cpp b/kdecoration/config/breezeconfigwidget.cpp index 3c5329bd..779f4308 100644 --- a/kdecoration/config/breezeconfigwidget.cpp +++ b/kdecoration/config/breezeconfigwidget.cpp @@ -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.drawTitleBarSeparator, SIGNAL(clicked()), SLOT(updateChanged()) ); // track animations changes connect( m_ui.animationsEnabled, SIGNAL(clicked()), SLOT(updateChanged()) ); @@ -84,6 +85,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.drawTitleBarSeparator->setChecked( m_internalSettings->drawTitleBarSeparator() ); // load shadows m_ui.shadowSize->setValue( m_internalSettings->shadowSize() ); @@ -115,6 +117,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->setDrawTitleBarSeparator(m_ui.drawTitleBarSeparator->isChecked()); m_internalSettings->setShadowSize( m_ui.shadowSize->value() ); m_internalSettings->setShadowStrength( qRound( qreal(m_ui.shadowStrength->value()*255)/100 ) ); @@ -161,6 +164,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.drawTitleBarSeparator->setChecked( m_internalSettings->drawTitleBarSeparator() ); m_ui.shadowSize->setValue( m_internalSettings->shadowSize() ); m_ui.shadowStrength->setValue( qRound(qreal(m_internalSettings->shadowStrength()*100)/255 ) ); @@ -178,6 +182,7 @@ namespace Breeze // track modifications bool modified( false ); + if (m_ui.drawTitleBarSeparator->isChecked() != m_internalSettings->drawTitleBarSeparator()) modified = true; if( m_ui.titleAlignment->currentIndex() != m_internalSettings->titleAlignment() ) modified = true; else if( m_ui.buttonSize->currentIndex() != m_internalSettings->buttonSize() ) modified = true; else if( m_ui.outlineCloseButton->isChecked() != m_internalSettings->outlineCloseButton() ) modified = true; diff --git a/kdecoration/config/ui/breezeconfigurationui.ui b/kdecoration/config/ui/breezeconfigurationui.ui index 076d8ed8..33d53a83 100644 --- a/kdecoration/config/ui/breezeconfigurationui.ui +++ b/kdecoration/config/ui/breezeconfigurationui.ui @@ -125,7 +125,7 @@ - + Qt::Vertical @@ -145,6 +145,13 @@ + + + + Draw separator between Title Bar and Window when colors differ + + + @@ -377,6 +384,7 @@ drawBorderOnMaximizedWindows drawBackgroundGradient drawSizeGrip + drawTitleBarSeparator animationsEnabled animationsDuration shadowSize