a bit of polish
This commit is contained in:
parent
4d3ba6b11f
commit
296328f12d
4 changed files with 22 additions and 16 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue