diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -4,6 +4,8 @@ Copyright (C) 2009 Marco Martin notmart@gmail.com Copyright (C) 2018 Vlad Zahorodnii +Copyright (C) 2019 Sefa Eyeoglu +Copyright (C) 2019 Nate Graham This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -136,33 +138,37 @@ switch (animData.location) { case Location::Left: if (slideLength < geo.width()) { - data.multiplyOpacity(t); + data.multiplyOpacity(interpolate(0.0, 1.0, t)); } + data.translate(-interpolate(qMin(geo.width(), slideLength), 0.0, t)); splitPoint = geo.width() - (geo.x() + geo.width() - screenRect.x() - animData.offset); region = QRegion(geo.x() + splitPoint, geo.y(), geo.width() - splitPoint, geo.height()); break; case Location::Top: if (slideLength < geo.height()) { - data.multiplyOpacity(t); + data.multiplyOpacity(interpolate(0.0, 1.0, t)); } + data.translate(0.0, -interpolate(qMin(geo.height(), slideLength), 0.0, t)); splitPoint = geo.height() - (geo.y() + geo.height() - screenRect.y() - animData.offset); region = QRegion(geo.x(), geo.y() + splitPoint, geo.width(), geo.height() - splitPoint); break; case Location::Right: if (slideLength < geo.width()) { - data.multiplyOpacity(t); + data.multiplyOpacity(interpolate(0.0, 1.0, t)); } + data.translate(interpolate(qMin(geo.width(), slideLength), 0.0, t)); splitPoint = screenRect.x() + screenRect.width() - geo.x() - animData.offset; region = QRegion(geo.x(), geo.y(), splitPoint, geo.height()); break; case Location::Bottom: default: if (slideLength < geo.height()) { - data.multiplyOpacity(t); + data.multiplyOpacity(interpolate(0.0, 1.0, t)); } + data.translate(0.0, interpolate(qMin(geo.height(), slideLength), 0.0, t)); splitPoint = screenRect.y() + screenRect.height() - geo.y() - animData.offset; region = QRegion(geo.x(), geo.y(), geo.width(), splitPoint); @@ -464,7 +470,7 @@ animation.kind = AnimationKind::In; animation.timeLine.setDirection(TimeLine::Forward); animation.timeLine.setDuration((*dataIt).slideInDuration); - animation.timeLine.setEasingCurve(QEasingCurve::InOutSine); + animation.timeLine.setEasingCurve(QEasingCurve::InQuad); // If the opposite animation (Out) was active and it had shorter duration, // at this point, the timeline can end up in the "done" state. Thus, we have @@ -503,7 +509,7 @@ animation.kind = AnimationKind::Out; animation.timeLine.setDirection(TimeLine::Backward); animation.timeLine.setDuration((*dataIt).slideOutDuration); - animation.timeLine.setEasingCurve(QEasingCurve::InOutSine); + animation.timeLine.setEasingCurve(QEasingCurve::OutQuad); // If the opposite animation (In) was active and it had shorter duration, // at this point, the timeline can end up in the "done" state. Thus, we have