Increase timeout for relayout in file system view

Possibly a bit less annoying in case this happens.

Task-number: QTCREATORBUG-19800
Change-Id: Ib4fe1cb577ff493a5e7a563d22b645889ce71e88
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Eike Ziller
2018-02-14 14:12:47 +01:00
parent b90f2fb251
commit d55271bc50

View File

@@ -845,6 +845,7 @@ int DelayedFileCrumbLabel::immediateHeightForWidth(int w) const
int DelayedFileCrumbLabel::heightForWidth(int w) const
{
static const int doubleDefaultInterval = 800;
static QHash<int, int> oldHeight;
setScrollBarOnce();
int newHeight = Utils::FileCrumbLabel::heightForWidth(w);
@@ -852,11 +853,13 @@ int DelayedFileCrumbLabel::heightForWidth(int w) const
oldHeight.insert(w, newHeight);
} else if (oldHeight.value(w) != newHeight){
auto that = const_cast<DelayedFileCrumbLabel *>(this);
QTimer::singleShot(QApplication::doubleClickInterval(), that, [that, w, newHeight] {
oldHeight.insert(w, newHeight);
that->m_delaying = false;
that->updateGeometry();
});
QTimer::singleShot(std::max(2 * QApplication::doubleClickInterval(), doubleDefaultInterval),
that,
[that, w, newHeight] {
oldHeight.insert(w, newHeight);
that->m_delaying = false;
that->updateGeometry();
});
}
return oldHeight.value(w);
}