@@ -150,7 +150,6 @@ namespace Breeze
150
150
// ________________________________________________________________
151
151
Decoration::Decoration (QObject *parent, const QVariantList &args)
152
152
: KDecoration2::Decoration(parent, args)
153
- , m_animation( new QVariantAnimation( this ) )
154
153
{
155
154
g_sDecoCount++;
156
155
}
@@ -166,28 +165,13 @@ namespace Breeze
166
165
}
167
166
}
168
167
169
- // ________________________________________________________________
170
- void Decoration::setOpacity (qreal value)
171
- {
172
- if (m_opacity == value)
173
- return ;
174
- m_opacity = value;
175
- update ();
176
- }
177
-
178
168
// ________________________________________________________________
179
169
QColor Decoration::titleBarColor () const
180
170
{
181
171
182
172
const auto c = client ().toStrongRef ();
183
173
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 );
191
175
192
176
}
193
177
@@ -196,13 +180,7 @@ namespace Breeze
196
180
{
197
181
198
182
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 );
206
184
207
185
}
208
186
@@ -211,15 +189,6 @@ namespace Breeze
211
189
{
212
190
const auto c = client ().toStrongRef ();
213
191
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
-
223
192
reconfigure ();
224
193
updateTitleBar ();
225
194
auto s = settings ();
@@ -253,7 +222,7 @@ namespace Breeze
253
222
}
254
223
);
255
224
256
- connect (c.data (), &KDecoration2::DecoratedClient::activeChanged, this , &Decoration::updateAnimationState );
225
+ connect (c.data (), &KDecoration2::DecoratedClient::activeChanged, this , &Decoration::updateActiveState );
257
226
connect (c.data (), &KDecoration2::DecoratedClient::widthChanged, this , &Decoration::updateTitleBar);
258
227
connect (c.data (), &KDecoration2::DecoratedClient::maximizedChanged, this , &Decoration::updateTitleBar);
259
228
// connect(c, &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::setOpaque);
@@ -293,22 +262,10 @@ namespace Breeze
293
262
}
294
263
295
264
// ________________________________________________________________
296
- void Decoration::updateAnimationState ()
265
+ void Decoration::updateActiveState ()
297
266
{
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 ();
312
269
}
313
270
314
271
// ________________________________________________________________
@@ -357,9 +314,6 @@ namespace Breeze
357
314
358
315
setScaledCornerRadius ();
359
316
360
- // animation
361
- m_animation->setDuration ( m_internalSettings->animationsDuration () );
362
-
363
317
// borders
364
318
recalculateBorders ();
365
319
0 commit comments