1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

LocationCompleterView: Always resize on first adjustSize after show

This commit is contained in:
David Rosca 2018-01-26 10:43:31 +01:00
parent 3ec4d96f74
commit 3469d5b114
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
2 changed files with 12 additions and 8 deletions

View File

@ -136,17 +136,20 @@ void LocationCompleterView::adjustSize()
});
}
if (newHeight == m_view->height() || newHeight == m_resizeHeight) {
return;
}
if (!m_forceResize) {
if (newHeight == m_view->height() || newHeight == m_resizeHeight) {
return;
}
if (newHeight < m_view->height()) {
m_resizeHeight = newHeight;
m_resizeTimer->start();
return;
if (newHeight < m_view->height()) {
m_resizeHeight = newHeight;
m_resizeTimer->start();
return;
}
}
m_resizeHeight = -1;
m_forceResize = false;
m_view->setFixedHeight(newHeight);
setFixedHeight(sizeHint().height());
}
@ -370,8 +373,8 @@ void LocationCompleterView::close()
{
hide();
m_view->verticalScrollBar()->setValue(0);
m_delegate->setShowSwitchToTab(true);
m_forceResize = true;
emit closed();
}

View File

@ -71,6 +71,7 @@ private:
QString m_originalText;
int m_resizeHeight = -1;
QTimer *m_resizeTimer = nullptr;
bool m_forceResize = true;
};
#endif // LOCATIONCOMPLETERVIEW_H