forked from qt-creator/qt-creator
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:
@@ -845,6 +845,7 @@ int DelayedFileCrumbLabel::immediateHeightForWidth(int w) const
|
|||||||
|
|
||||||
int DelayedFileCrumbLabel::heightForWidth(int w) const
|
int DelayedFileCrumbLabel::heightForWidth(int w) const
|
||||||
{
|
{
|
||||||
|
static const int doubleDefaultInterval = 800;
|
||||||
static QHash<int, int> oldHeight;
|
static QHash<int, int> oldHeight;
|
||||||
setScrollBarOnce();
|
setScrollBarOnce();
|
||||||
int newHeight = Utils::FileCrumbLabel::heightForWidth(w);
|
int newHeight = Utils::FileCrumbLabel::heightForWidth(w);
|
||||||
@@ -852,11 +853,13 @@ int DelayedFileCrumbLabel::heightForWidth(int w) const
|
|||||||
oldHeight.insert(w, newHeight);
|
oldHeight.insert(w, newHeight);
|
||||||
} else if (oldHeight.value(w) != newHeight){
|
} else if (oldHeight.value(w) != newHeight){
|
||||||
auto that = const_cast<DelayedFileCrumbLabel *>(this);
|
auto that = const_cast<DelayedFileCrumbLabel *>(this);
|
||||||
QTimer::singleShot(QApplication::doubleClickInterval(), that, [that, w, newHeight] {
|
QTimer::singleShot(std::max(2 * QApplication::doubleClickInterval(), doubleDefaultInterval),
|
||||||
oldHeight.insert(w, newHeight);
|
that,
|
||||||
that->m_delaying = false;
|
[that, w, newHeight] {
|
||||||
that->updateGeometry();
|
oldHeight.insert(w, newHeight);
|
||||||
});
|
that->m_delaying = false;
|
||||||
|
that->updateGeometry();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return oldHeight.value(w);
|
return oldHeight.value(w);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user