mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Improve speed when we have lots of selections that are partially outside the viewport.
svn path=/trunk/KDE/kdebase/apps/; revision=682114
This commit is contained in:
parent
2578bea1d8
commit
94cfa325ca
1 changed files with 10 additions and 6 deletions
|
@ -399,25 +399,29 @@ void KListView::Private::drawDraggedItems(QPainter *painter)
|
|||
option.rect = visualRect(index);
|
||||
option.rect.adjust(dx, dy, dx, dy);
|
||||
|
||||
listView->itemDelegate(index)->paint(painter, option, index);
|
||||
if (option.rect.intersects(listView->viewport()->rect()))
|
||||
{
|
||||
listView->itemDelegate(index)->paint(painter, option, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KListView::Private::drawDraggedItems()
|
||||
{
|
||||
int dx;
|
||||
int dy;
|
||||
QRect rectToUpdate;
|
||||
QRect currentRect;
|
||||
foreach (const QModelIndex &index, listView->selectionModel()->selectedIndexes())
|
||||
{
|
||||
dx = mousePosition.x() - initialPressPosition.x() + listView->horizontalOffset();
|
||||
dy = mousePosition.y() - initialPressPosition.y() + listView->verticalOffset();
|
||||
int dx = mousePosition.x() - initialPressPosition.x() + listView->horizontalOffset();
|
||||
int dy = mousePosition.y() - initialPressPosition.y() + listView->verticalOffset();
|
||||
|
||||
currentRect = visualRect(index);
|
||||
currentRect.adjust(dx, dy, dx, dy);
|
||||
|
||||
rectToUpdate = rectToUpdate.united(currentRect);
|
||||
if (currentRect.intersects(listView->viewport()->rect()))
|
||||
{
|
||||
rectToUpdate = rectToUpdate.united(currentRect);
|
||||
}
|
||||
}
|
||||
|
||||
listView->viewport()->update(lastDraggedItemsRect);
|
||||
|
|
Loading…
Reference in a new issue