Changeset View
Changeset View
Standalone View
Standalone View
effects/slidingpopups/slidingpopups.cpp
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Line(s) | 121 | { | |||
---|---|---|---|---|---|
130 | 130 | | |||
131 | const QRect screenRect = effects->clientArea(FullScreenArea, w->screen(), effects->currentDesktop()); | 131 | const QRect screenRect = effects->clientArea(FullScreenArea, w->screen(), effects->currentDesktop()); | ||
132 | int splitPoint = 0; | 132 | int splitPoint = 0; | ||
133 | const QRect geo = w->expandedGeometry(); | 133 | const QRect geo = w->expandedGeometry(); | ||
134 | const qreal t = (*animationIt).timeLine.value(); | 134 | const qreal t = (*animationIt).timeLine.value(); | ||
135 | 135 | | |||
136 | switch (animData.location) { | 136 | switch (animData.location) { | ||
137 | case Location::Left: | 137 | case Location::Left: | ||
138 | if (slideLength < geo.width()) { | 138 | if (slideLength < geo.width()) { | ||
davidedmundson: Have you tested this with the autohide panel. I doubt it will look good.
We want that for… | |||||
139 | data.multiplyOpacity(t); | 139 | data.multiplyOpacity(t); | ||
data.multiplyOpacity(t) and data.multiplyOpacity(interpolate(0.0, 1.0, t)); do the same thing. Could you please revert this change? zzag: `data.multiplyOpacity(t)` and `data.multiplyOpacity(interpolate(0.0, 1.0, t));` do the same… | |||||
140 | } | 140 | } | ||
141 | data.translate(-interpolate(qMin(geo.width(), slideLength), 0.0, t)); | 141 | data.translate(-interpolate(qMin(geo.width(), slideLength), 0.0, t)); | ||
142 | splitPoint = geo.width() - (geo.x() + geo.width() - screenRect.x() - animData.offset); | 142 | splitPoint = geo.width() - (geo.x() + geo.width() - screenRect.x() - animData.offset); | ||
143 | region = QRegion(geo.x() + splitPoint, geo.y(), geo.width() - splitPoint, geo.height()); | 143 | region = QRegion(geo.x() + splitPoint, geo.y(), geo.width() - splitPoint, geo.height()); | ||
144 | break; | 144 | break; | ||
zzag: Unrelated change. | |||||
145 | case Location::Top: | 145 | case Location::Top: | ||
146 | if (slideLength < geo.height()) { | 146 | if (slideLength < geo.height()) { | ||
147 | data.multiplyOpacity(t); | 147 | data.multiplyOpacity(t); | ||
148 | } | 148 | } | ||
149 | data.translate(0.0, -interpolate(qMin(geo.height(), slideLength), 0.0, t)); | 149 | data.translate(0.0, -interpolate(qMin(geo.height(), slideLength), 0.0, t)); | ||
150 | splitPoint = geo.height() - (geo.y() + geo.height() - screenRect.y() - animData.offset); | 150 | splitPoint = geo.height() - (geo.y() + geo.height() - screenRect.y() - animData.offset); | ||
151 | region = QRegion(geo.x(), geo.y() + splitPoint, geo.width(), geo.height() - splitPoint); | 151 | region = QRegion(geo.x(), geo.y() + splitPoint, geo.width(), geo.height() - splitPoint); | ||
152 | break; | 152 | break; | ||
▲ Show 20 Lines • Show All 306 Lines • ▼ Show 20 Line(s) | 449 | { | |||
459 | if (dataIt == m_animationsData.constEnd()) { | 459 | if (dataIt == m_animationsData.constEnd()) { | ||
460 | return; | 460 | return; | ||
461 | } | 461 | } | ||
462 | 462 | | |||
463 | Animation &animation = m_animations[w]; | 463 | Animation &animation = m_animations[w]; | ||
464 | animation.kind = AnimationKind::In; | 464 | animation.kind = AnimationKind::In; | ||
465 | animation.timeLine.setDirection(TimeLine::Forward); | 465 | animation.timeLine.setDirection(TimeLine::Forward); | ||
466 | animation.timeLine.setDuration((*dataIt).slideInDuration); | 466 | animation.timeLine.setDuration((*dataIt).slideInDuration); | ||
467 | animation.timeLine.setEasingCurve(QEasingCurve::InOutSine); | 467 | animation.timeLine.setEasingCurve(QEasingCurve::OutQuad); | ||
Let's make this InQuad to be consistent with most other animations in Plasma, and conform to the emerging guidelines in D25343. ngraham: Let's make this `InQuad` to be consistent with most other animations in Plasma, and conform to… | |||||
468 | 468 | | |||
469 | // If the opposite animation (Out) was active and it had shorter duration, | 469 | // If the opposite animation (Out) was active and it had shorter duration, | ||
470 | // at this point, the timeline can end up in the "done" state. Thus, we have | 470 | // at this point, the timeline can end up in the "done" state. Thus, we have | ||
471 | // to reset it. | 471 | // to reset it. | ||
472 | if (animation.timeLine.done()) { | 472 | if (animation.timeLine.done()) { | ||
473 | animation.timeLine.reset(); | 473 | animation.timeLine.reset(); | ||
474 | } | 474 | } | ||
475 | 475 | | |||
Show All 22 Lines | 484 | { | |||
498 | if (w->isDeleted()) { | 498 | if (w->isDeleted()) { | ||
499 | w->refWindow(); | 499 | w->refWindow(); | ||
500 | } | 500 | } | ||
501 | 501 | | |||
502 | Animation &animation = m_animations[w]; | 502 | Animation &animation = m_animations[w]; | ||
503 | animation.kind = AnimationKind::Out; | 503 | animation.kind = AnimationKind::Out; | ||
504 | animation.timeLine.setDirection(TimeLine::Backward); | 504 | animation.timeLine.setDirection(TimeLine::Backward); | ||
505 | animation.timeLine.setDuration((*dataIt).slideOutDuration); | 505 | animation.timeLine.setDuration((*dataIt).slideOutDuration); | ||
506 | animation.timeLine.setEasingCurve(QEasingCurve::InOutSine); | 506 | // this is effectively InQuad because the direction is reversed | ||
507 | animation.timeLine.setEasingCurve(QEasingCurve::OutQuad); | ||||
The comment here needs to be changed. It says InQuart, as I was experimenting with different easing functions before settling on OutExpo. sefaeyeoglu: The comment here needs to be changed. It says InQuart, as I was experimenting with different… | |||||
Technically the "OutQuad" here turns into "InQuad". In L504 the animation is reversed, which also reverses the easing curve. sefaeyeoglu: Technically the "OutQuad" here turns into "InQuad". In L504 the animation is reversed, which… | |||||
507 | 508 | | |||
508 | // If the opposite animation (In) was active and it had shorter duration, | 509 | // If the opposite animation (In) was active and it had shorter duration, | ||
509 | // at this point, the timeline can end up in the "done" state. Thus, we have | 510 | // at this point, the timeline can end up in the "done" state. Thus, we have | ||
510 | // to reset it. | 511 | // to reset it. | ||
511 | if (animation.timeLine.done()) { | 512 | if (animation.timeLine.done()) { | ||
512 | animation.timeLine.reset(); | 513 | animation.timeLine.reset(); | ||
513 | } | 514 | } | ||
514 | 515 | | |||
Show All 29 Lines |
Have you tested this with the autohide panel. I doubt it will look good.
We want that for newly appearing windows in the middle of the screen, but not for a window that clearly comes in from offscreen.
The current heuristic of basing that off slideLength seems to work.