From d2ccf2df45e54efbe795ba956462e044d83aee25 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Thu, 23 Apr 2015 15:10:20 +0200 Subject: [PATCH] overall cleanup to align with oxygen code --- kdecoration/breezebutton.cpp | 6 ++---- kdecoration/breezebutton.h | 10 +++++----- kdecoration/breezedecoration.cpp | 23 +++++++++++------------ 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/kdecoration/breezebutton.cpp b/kdecoration/breezebutton.cpp index 01a1a9ca..7a0ffa49 100644 --- a/kdecoration/breezebutton.cpp +++ b/kdecoration/breezebutton.cpp @@ -45,7 +45,8 @@ namespace Breeze const int height = decoration->buttonHeight(); setGeometry(QRect(0, 0, height, height)); - // connect hover state changed + // connections + connect(decoration->client().data(), SIGNAL(iconChanged(QIcon)), this, SLOT(update())); connect( this, &KDecoration2::DecorationButton::hoveredChanged, this, &Button::updateAnimationState ); } @@ -106,9 +107,6 @@ namespace Breeze } - //__________________________________________________________________ - Button::~Button() = default; - //__________________________________________________________________ void Button::paint(QPainter *painter, const QRect &repaintRegion) { diff --git a/kdecoration/breezebutton.h b/kdecoration/breezebutton.h index c43959a0..3787e2b4 100644 --- a/kdecoration/breezebutton.h +++ b/kdecoration/breezebutton.h @@ -44,14 +44,14 @@ namespace Breeze explicit Button(QObject *parent, const QVariantList &args); //* destructor - virtual ~Button(); + virtual ~Button() = default; - //* render - void paint(QPainter *painter, const QRect &repaintRegion) override; - - //* create + //* button creation static Button *create(KDecoration2::DecorationButtonType type, KDecoration2::Decoration *decoration, QObject *parent); + //* render + virtual void paint(QPainter *painter, const QRect &repaintRegion) Q_DECL_OVERRIDE; + //* flag enum Flag { diff --git a/kdecoration/breezedecoration.cpp b/kdecoration/breezedecoration.cpp index 424442a1..90f4f2e9 100644 --- a/kdecoration/breezedecoration.cpp +++ b/kdecoration/breezedecoration.cpp @@ -140,7 +140,6 @@ namespace Breeze m_colorSettings.update(client().data()->palette(), *client().data()); m_useSeparator = (m_colorSettings.palette().color( QPalette::Window ) != m_colorSettings.activeTitleBar() ); - // active state change animation m_animation->setStartValue( 0 ); m_animation->setEndValue( 1.0 ); @@ -482,11 +481,11 @@ namespace Breeze const int baseSize = settings()->gridUnit(); switch( m_internalSettings->buttonSize() ) { - case Breeze::InternalSettings::ButtonSmall: return baseSize*1.5; + case InternalSettings::ButtonSmall: return baseSize*1.5; default: - case Breeze::InternalSettings::ButtonDefault: return baseSize*2; - case Breeze::InternalSettings::ButtonLarge: return baseSize*2.5; - case Breeze::InternalSettings::ButtonVeryLarge: return baseSize*3.5; + case InternalSettings::ButtonDefault: return baseSize*2; + case InternalSettings::ButtonLarge: return baseSize*2.5; + case InternalSettings::ButtonVeryLarge: return baseSize*3.5; } } @@ -508,17 +507,17 @@ namespace Breeze switch( m_internalSettings->titleAlignment() ) { - case Breeze::InternalSettings::AlignLeft: + case InternalSettings::AlignLeft: return qMakePair( maxRect, Qt::AlignVCenter|Qt::AlignLeft ); - case Breeze::InternalSettings::AlignRight: + case InternalSettings::AlignRight: return qMakePair( maxRect, Qt::AlignVCenter|Qt::AlignRight ); - case Breeze::InternalSettings::AlignCenter: + case InternalSettings::AlignCenter: return qMakePair( maxRect, Qt::AlignCenter ); default: - case Breeze::InternalSettings::AlignCenterFullWidth: + case InternalSettings::AlignCenterFullWidth: { // full caption rect @@ -634,9 +633,9 @@ namespace Breeze if( c->windowId() != 0 ) { m_sizeGrip = new SizeGrip( this ); - connect( client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Breeze::Decoration::updateSizeGripVisibility ); - connect( client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, &Breeze::Decoration::updateSizeGripVisibility ); - connect( client().data(), &KDecoration2::DecoratedClient::resizeableChanged, this, &Breeze::Decoration::updateSizeGripVisibility ); + connect( client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateSizeGripVisibility ); + connect( client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateSizeGripVisibility ); + connect( client().data(), &KDecoration2::DecoratedClient::resizeableChanged, this, &Decoration::updateSizeGripVisibility ); } #endif