mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 16:31:21 +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
|
@ -743,6 +743,7 @@ void KCategorizedView::paintEvent(QPaintEvent *event)
|
||||||
|
|
||||||
// Redraw categories
|
// Redraw categories
|
||||||
QStyleOptionViewItem otherOption;
|
QStyleOptionViewItem otherOption;
|
||||||
|
bool intersectedInThePast = false;
|
||||||
foreach (const QString &category, d->categories)
|
foreach (const QString &category, d->categories)
|
||||||
{
|
{
|
||||||
otherOption = option;
|
otherOption = option;
|
||||||
|
@ -751,11 +752,18 @@ void KCategorizedView::paintEvent(QPaintEvent *event)
|
||||||
|
|
||||||
if (otherOption.rect.intersects(area))
|
if (otherOption.rect.intersects(area))
|
||||||
{
|
{
|
||||||
|
intersectedInThePast = true;
|
||||||
|
|
||||||
QModelIndex indexToDraw = d->proxyModel->index(d->categoriesIndexes[category][0].row(), d->proxyModel->sortColumn());
|
QModelIndex indexToDraw = d->proxyModel->index(d->categoriesIndexes[category][0].row(), d->proxyModel->sortColumn());
|
||||||
|
|
||||||
d->drawNewCategory(indexToDraw,
|
d->drawNewCategory(indexToDraw,
|
||||||
d->proxyModel->sortRole(), otherOption, &painter);
|
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)
|
if (d->mouseButtonPressed && !d->isDragging)
|
||||||
|
|
Loading…
Reference in a new issue