From 92880381b8689ee1a18547e2beb0f0fe99259593 Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Sat, 4 Aug 2018 19:36:25 +0300 Subject: [PATCH] [effects/minimizeanimation] Fix coding style Summary: This change doesn't add new features or bugfixes, it only makes code look uniform. Test Plan: Still compiles. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D14608 --- effects/minimizeanimation/minimizeanimation.cpp | 15 +++++++++------ effects/minimizeanimation/minimizeanimation.h | 10 +++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/effects/minimizeanimation/minimizeanimation.cpp b/effects/minimizeanimation/minimizeanimation.cpp index 99d1a5d5a9..569d8d34f1 100644 --- a/effects/minimizeanimation/minimizeanimation.cpp +++ b/effects/minimizeanimation/minimizeanimation.cpp @@ -46,7 +46,7 @@ bool MinimizeAnimationEffect::supported() return effects->animationsSupported(); } -void MinimizeAnimationEffect::prePaintScreen(ScreenPrePaintData& data, int time) +void MinimizeAnimationEffect::prePaintScreen(ScreenPrePaintData &data, int time) { const std::chrono::milliseconds delta(time); @@ -63,7 +63,7 @@ void MinimizeAnimationEffect::prePaintScreen(ScreenPrePaintData& data, int time) effects->prePaintScreen(data, time); } -void MinimizeAnimationEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) +void MinimizeAnimationEffect::prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time) { // Schedule window for transformation if the animation is still in // progress @@ -76,7 +76,7 @@ void MinimizeAnimationEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData effects->prePaintWindow(w, data, time); } -void MinimizeAnimationEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) +void MinimizeAnimationEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) { const auto animationIt = m_animations.constFind(w); if (animationIt != m_animations.constEnd()) { @@ -86,8 +86,9 @@ void MinimizeAnimationEffect::paintWindow(EffectWindow* w, int mask, QRegion reg QRect geo = w->geometry(); QRect icon = w->iconGeometry(); // If there's no icon geometry, minimize to the center of the screen - if (!icon.isValid()) + if (!icon.isValid()) { icon = QRect(effects->virtualScreenGeometry().center(), QSize(0, 0)); + } data *= QVector2D(interpolate(1.0, icon.width() / (double)geo.width(), progress), interpolate(1.0, icon.height() / (double)geo.height(), progress)); @@ -124,8 +125,9 @@ void MinimizeAnimationEffect::windowDeleted(EffectWindow *w) void MinimizeAnimationEffect::windowMinimized(EffectWindow *w) { - if (effects->activeFullScreenEffect()) + if (effects->activeFullScreenEffect()) { return; + } TimeLine &timeLine = m_animations[w]; @@ -142,8 +144,9 @@ void MinimizeAnimationEffect::windowMinimized(EffectWindow *w) void MinimizeAnimationEffect::windowUnminimized(EffectWindow *w) { - if (effects->activeFullScreenEffect()) + if (effects->activeFullScreenEffect()) { return; + } TimeLine &timeLine = m_animations[w]; diff --git a/effects/minimizeanimation/minimizeanimation.h b/effects/minimizeanimation/minimizeanimation.h index df28c859d0..db9f74aeac 100644 --- a/effects/minimizeanimation/minimizeanimation.h +++ b/effects/minimizeanimation/minimizeanimation.h @@ -30,18 +30,18 @@ namespace KWin /** * Animates minimize/unminimize **/ -class MinimizeAnimationEffect - : public Effect +class MinimizeAnimationEffect : public Effect { Q_OBJECT + public: MinimizeAnimationEffect(); void reconfigure(ReconfigureFlags flags) override; - virtual void prePaintScreen(ScreenPrePaintData& data, int time); - virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time); - virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); + virtual void prePaintScreen(ScreenPrePaintData &data, int time); + virtual void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time); + virtual void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data); virtual void postPaintScreen(); virtual bool isActive() const;