[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
This commit is contained in:
Vlad Zagorodniy 2018-08-04 19:36:25 +03:00
parent ce9965ccad
commit 92880381b8
2 changed files with 14 additions and 11 deletions

View file

@ -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];

View file

@ -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;