mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Even better behavior when different possibilities, grid or not grid, spacing or not spacing
svn path=/trunk/KDE/kdebase/apps/; revision=687849
This commit is contained in:
parent
194ce9fe18
commit
6d858cd70f
1 changed files with 38 additions and 12 deletions
|
@ -201,15 +201,32 @@ QRect KCategorizedView::Private::visualRectInViewport(const QModelIndex &index)
|
|||
|
||||
if (rows - trunc(rows)) rowsInt++;
|
||||
|
||||
retRect.setTop(retRect.top() +
|
||||
(rowsInt * listView->spacing()) +
|
||||
(rowsInt * itemHeight) +
|
||||
itemCategorizer->categoryHeight(listView->viewOptions()) +
|
||||
listView->spacing() * 2);
|
||||
if (listView->gridSize().isEmpty())
|
||||
{
|
||||
retRect.setTop(retRect.top() +
|
||||
(rowsInt * listView->spacing()) +
|
||||
(rowsInt * itemHeight) +
|
||||
itemCategorizer->categoryHeight(listView->viewOptions()) +
|
||||
listView->spacing() * 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
retRect.setTop(retRect.top() +
|
||||
(rowsInt * itemHeight) +
|
||||
itemCategorizer->categoryHeight(listView->viewOptions()));
|
||||
}
|
||||
}
|
||||
|
||||
retRect.setTop(retRect.top() + row * listView->spacing() +
|
||||
row * itemHeight);
|
||||
|
||||
if (listView->gridSize().isEmpty())
|
||||
{
|
||||
retRect.setTop(retRect.top() + row * listView->spacing() +
|
||||
(row * itemHeight));
|
||||
}
|
||||
else
|
||||
{
|
||||
retRect.setTop(retRect.top() + (row * itemHeight));
|
||||
}
|
||||
|
||||
retRect.setWidth(itemWidth);
|
||||
|
||||
|
@ -272,11 +289,20 @@ QRect KCategorizedView::Private::visualCategoryRectInViewport(const QString &cat
|
|||
|
||||
if (rows - trunc(rows)) rowsInt++;
|
||||
|
||||
retRect.setTop(retRect.top() +
|
||||
(rowsInt * listView->spacing()) +
|
||||
(rowsInt * itemHeight) +
|
||||
itemCategorizer->categoryHeight(listView->viewOptions()) +
|
||||
listView->spacing() * 2);
|
||||
if (listView->gridSize().isEmpty())
|
||||
{
|
||||
retRect.setTop(retRect.top() +
|
||||
(rowsInt * listView->spacing()) +
|
||||
(rowsInt * itemHeight) +
|
||||
itemCategorizer->categoryHeight(listView->viewOptions()) +
|
||||
listView->spacing() * 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
retRect.setTop(retRect.top() +
|
||||
(rowsInt * itemHeight) +
|
||||
itemCategorizer->categoryHeight(listView->viewOptions()));
|
||||
}
|
||||
}
|
||||
|
||||
retRect.setHeight(itemCategorizer->categoryHeight(listView->viewOptions()));
|
||||
|
|
Loading…
Reference in a new issue