plugins/slidingpopups: use standard duration values

Right now the opening duration is 150ms, and the closing duration is
250ms. Neither are standard durations we use elsewhere, and it's also a
bit odd to be slower to close than to open--at least from a visual
perspective.

The average of these value happens to be 200ms, which happily is the
exact value of Kirigami.Units.longDuration.

As such, use that value instead, in the interests of visual consistency.
This commit is contained in:
Nate Graham 2024-05-15 09:06:05 -06:00
parent 77794e1333
commit 29a93a2e57

View file

@ -101,10 +101,11 @@ bool SlidingPopupsEffect::supported()
void SlidingPopupsEffect::reconfigure(ReconfigureFlags flags)
{
SlidingPopupsConfig::self()->read();
// Keep these durations in sync with the value of Kirigami.Units.longDuration
m_slideInDuration = std::chrono::milliseconds(
static_cast<int>(animationTime(SlidingPopupsConfig::slideInTime() != 0 ? std::chrono::milliseconds(SlidingPopupsConfig::slideInTime()) : 150ms)));
static_cast<int>(animationTime(SlidingPopupsConfig::slideInTime() != 0 ? std::chrono::milliseconds(SlidingPopupsConfig::slideInTime()) : 200ms)));
m_slideOutDuration = std::chrono::milliseconds(
static_cast<int>(animationTime(SlidingPopupsConfig::slideOutTime() != 0 ? std::chrono::milliseconds(SlidingPopupsConfig::slideOutTime()) : 250ms)));
static_cast<int>(animationTime(SlidingPopupsConfig::slideOutTime() != 0 ? std::chrono::milliseconds(SlidingPopupsConfig::slideOutTime()) : 200ms)));
auto animationIt = m_animations.begin();
while (animationIt != m_animations.end()) {