1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

ComboTabBar: Fix using correct value for tab animation duration

This commit is contained in:
David Rosca 2017-01-27 13:58:48 +01:00
parent f7d4054cb9
commit 6132bf7789

View File

@ -1221,9 +1221,7 @@ void TabBarHelper::mouseReleaseEvent(QMouseEvent* event)
QTabBar::mouseReleaseEvent(event);
if (m_pressedIndex >= 0 && m_pressedIndex < count()) {
const int length = qAbs(m_pressedGlobalX - event->globalX());
const int duration = qMin((length * ANIMATION_DURATION) / tabRect(m_pressedIndex).width(), ANIMATION_DURATION);
QTimer::singleShot(duration, this, SLOT(resetDragState()));
QTimer::singleShot(ANIMATION_DURATION, this, &TabBarHelper::resetDragState);
m_pressedIndex = -1;
m_pressedGlobalX = -1;