mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
If we are out of the screen and we will be, why keep asking when we know that no category will intersect from now with the viewport
svn path=/trunk/KDE/kdebase/apps/; revision=725213
This commit is contained in:
parent
417a1f6256
commit
6d10e57f88
1 changed files with 8 additions and 0 deletions
|
@ -743,6 +743,7 @@ void KCategorizedView::paintEvent(QPaintEvent *event)
|
|||
|
||||
// Redraw categories
|
||||
QStyleOptionViewItem otherOption;
|
||||
bool intersectedInThePast = false;
|
||||
foreach (const QString &category, d->categories)
|
||||
{
|
||||
otherOption = option;
|
||||
|
@ -751,11 +752,18 @@ void KCategorizedView::paintEvent(QPaintEvent *event)
|
|||
|
||||
if (otherOption.rect.intersects(area))
|
||||
{
|
||||
intersectedInThePast = true;
|
||||
|
||||
QModelIndex indexToDraw = d->proxyModel->index(d->categoriesIndexes[category][0].row(), d->proxyModel->sortColumn());
|
||||
|
||||
d->drawNewCategory(indexToDraw,
|
||||
d->proxyModel->sortRole(), otherOption, &painter);
|
||||
}
|
||||
else if (intersectedInThePast)
|
||||
{
|
||||
break; // the visible area has been finished, we don't need to keep asking, the rest won't intersect
|
||||
// this is doable because we know that categories are correctly ordered on the list
|
||||
}
|
||||
}
|
||||
|
||||
if (d->mouseButtonPressed && !d->isDragging)
|
||||
|
|
Loading…
Reference in a new issue