a bit of polish

This commit is contained in:
Blue 2022-01-11 23:50:42 +03:00
parent 4d3ba6b11f
commit 296328f12d
Signed by: blue
GPG key ID: 9B203B252A63EE38
4 changed files with 22 additions and 16 deletions

View file

@ -255,7 +255,6 @@ void FeedView::updateGeometries()
bool FeedView::tryToCalculateGeometriesWithNoScrollbars(const QStyleOptionViewItem& option, const QAbstractItemModel* m, uint32_t totalHeight)
{
uint32_t previousOffset = elementMargin;
bool success = true;
QDateTime lastDate;
for (int i = 0, size = m->rowCount(); i < size; ++i) {
QModelIndex index = m->index(i, 0, rootIndex());
@ -271,8 +270,7 @@ bool FeedView::tryToCalculateGeometriesWithNoScrollbars(const QStyleOptionViewIt
QSize messageSize = itemDelegate(index)->sizeHint(option, index);
if (previousOffset + messageSize.height() + elementMargin > totalHeight) {
success = false;
break;
return false;
}
uint32_t offsetX(0);
@ -295,10 +293,10 @@ bool FeedView::tryToCalculateGeometriesWithNoScrollbars(const QStyleOptionViewIt
previousOffset += dateDeviderMargin * 2 + dividerMetrics.height();
if (previousOffset > totalHeight) {
success = false;
return false;
}
return success;
return true;
}