Skip to content

Commit add552e

Browse files
committed
Removed activation state animation
1 parent a1cd1d6 commit add552e

File tree

5 files changed

+10
-71
lines changed

5 files changed

+10
-71
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
12

23
project(breezeenhanced)
34
set(PROJECT_VERSION "5.27.0")
45
set(PROJECT_VERSION_MAJOR 5)
56

6-
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
7-
87
include(WriteBasicConfigVersionFile)
98
include(FeatureSummary)
109

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ V5.27
44
* Removed the option about drawing border on maximized and tiled windows (it was both ugly and confusing).
55
* Removed the 1-pix empty gap below shaded windows.
66
* Smaller shadow for inactive windows (without any shadow animation).
7+
* Removed the activation state animation. It was redundant and wasn't consistent with Qt's activation state (which Kvantum supports).
78

89
V5.26
910
---------

NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Latest version:
22

3-
14 Mar 2023, V5.27
3+
24 Mar 2023, V5.27
44

55
See "ChangeLog" for changes.

breezedecoration.cpp

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ namespace Breeze
150150
//________________________________________________________________
151151
Decoration::Decoration(QObject *parent, const QVariantList &args)
152152
: KDecoration2::Decoration(parent, args)
153-
, m_animation( new QVariantAnimation( this ) )
154153
{
155154
g_sDecoCount++;
156155
}
@@ -166,28 +165,13 @@ namespace Breeze
166165
}
167166
}
168167

169-
//________________________________________________________________
170-
void Decoration::setOpacity(qreal value)
171-
{
172-
if (m_opacity == value)
173-
return;
174-
m_opacity = value;
175-
update();
176-
}
177-
178168
//________________________________________________________________
179169
QColor Decoration::titleBarColor() const
180170
{
181171

182172
const auto c = client().toStrongRef();
183173
if( hideTitleBar() ) return c->color( ColorGroup::Inactive, ColorRole::TitleBar );
184-
else if( m_animation->state() == QAbstractAnimation::Running )
185-
{
186-
return KColorUtils::mix(
187-
c->color( ColorGroup::Inactive, ColorRole::TitleBar ),
188-
c->color( ColorGroup::Active, ColorRole::TitleBar ),
189-
m_opacity );
190-
} else return c->color( c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::TitleBar );
174+
return c->color( c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::TitleBar );
191175

192176
}
193177

@@ -196,13 +180,7 @@ namespace Breeze
196180
{
197181

198182
const auto c = client().toStrongRef();
199-
if( m_animation->state() == QAbstractAnimation::Running )
200-
{
201-
return KColorUtils::mix(
202-
c->color( ColorGroup::Inactive, ColorRole::Foreground ),
203-
c->color( ColorGroup::Active, ColorRole::Foreground ),
204-
m_opacity );
205-
} else return c->color( c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::Foreground );
183+
return c->color( c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::Foreground );
206184

207185
}
208186

@@ -211,15 +189,6 @@ namespace Breeze
211189
{
212190
const auto c = client().toStrongRef();
213191

214-
// active state change animation
215-
// It is important start and end value are of the same type, hence 0.0 and not just 0
216-
m_animation->setStartValue( 0.0 );
217-
m_animation->setEndValue( 1.0 );
218-
m_animation->setEasingCurve( QEasingCurve::InOutQuad );
219-
connect(m_animation, &QVariantAnimation::valueChanged, this, [this](const QVariant &value) {
220-
setOpacity(value.toReal());
221-
});
222-
223192
reconfigure();
224193
updateTitleBar();
225194
auto s = settings();
@@ -253,7 +222,7 @@ namespace Breeze
253222
}
254223
);
255224

256-
connect(c.data(), &KDecoration2::DecoratedClient::activeChanged, this, &Decoration::updateAnimationState);
225+
connect(c.data(), &KDecoration2::DecoratedClient::activeChanged, this, &Decoration::updateActiveState);
257226
connect(c.data(), &KDecoration2::DecoratedClient::widthChanged, this, &Decoration::updateTitleBar);
258227
connect(c.data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateTitleBar);
259228
//connect(c, &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::setOpaque);
@@ -293,22 +262,10 @@ namespace Breeze
293262
}
294263

295264
//________________________________________________________________
296-
void Decoration::updateAnimationState()
265+
void Decoration::updateActiveState()
297266
{
298-
// active and inactive shadows are different
299-
updateShadow();
300-
301-
if (m_internalSettings->animationsEnabled())
302-
{
303-
const auto c = client().toStrongRef();
304-
m_animation->setDirection(c->isActive() ? QAbstractAnimation::Forward : QAbstractAnimation::Backward);
305-
if (m_animation->state() != QAbstractAnimation::Running)
306-
m_animation->start();
307-
}
308-
else
309-
{
310-
update();
311-
}
267+
updateShadow(); // active and inactive shadows are different
268+
update();
312269
}
313270

314271
//________________________________________________________________
@@ -357,9 +314,6 @@ namespace Breeze
357314

358315
setScaledCornerRadius();
359316

360-
// animation
361-
m_animation->setDuration( m_internalSettings->animationsDuration() );
362-
363317
// borders
364318
recalculateBorders();
365319

breezedecoration.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,6 @@ namespace Breeze
6666
//* button height
6767
int buttonHeight() const;
6868

69-
//*@name active state change animation
70-
//@{
71-
void setOpacity( qreal );
72-
73-
qreal opacity() const
74-
{ return m_opacity; }
75-
76-
//@}
77-
7869
//*@name colors
7970
//@{
8071
QColor titleBarColor() const;
@@ -105,7 +96,7 @@ namespace Breeze
10596
void updateButtonsGeometry();
10697
void updateButtonsGeometryDelayed();
10798
void updateTitleBar();
108-
void updateAnimationState();
99+
void updateActiveState();
109100

110101
private:
111102

@@ -137,12 +128,6 @@ namespace Breeze
137128
KDecoration2::DecorationButtonGroup *m_leftButtons = nullptr;
138129
KDecoration2::DecorationButtonGroup *m_rightButtons = nullptr;
139130

140-
//* active state change animation
141-
QVariantAnimation *m_animation;
142-
143-
//* active state change opacity
144-
qreal m_opacity = 0;
145-
146131
//*frame corner radius, scaled according to DPI
147132
qreal m_scaledCornerRadius = 3;
148133
};

0 commit comments

Comments
 (0)