X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/4391635b5dcc7470cbd35d9651282696747ce764..ac73af7bedeebe2afa451249e8a6500651a6ec00:/src/kcategorizedview.cpp diff --git a/src/kcategorizedview.cpp b/src/kcategorizedview.cpp index b2504a14b..648a712a5 100644 --- a/src/kcategorizedview.cpp +++ b/src/kcategorizedview.cpp @@ -129,12 +129,12 @@ QRect KCategorizedView::Private::visualRectInViewport(const QModelIndex &index) if (listView->layoutDirection() == Qt::LeftToRight) { retRect = QRect(listView->spacing(), listView->spacing() * 2 + - categoryDrawer->categoryHeight(listView->viewOptions()), 0, 0); + categoryDrawer->categoryHeight(index, listView->viewOptions()), 0, 0); } else { retRect = QRect(listView->viewport()->width() - listView->spacing(), listView->spacing() * 2 + - categoryDrawer->categoryHeight(listView->viewOptions()), 0, 0); + categoryDrawer->categoryHeight(index, listView->viewOptions()), 0, 0); } int viewportWidth = listView->viewport()->width() - listView->spacing(); @@ -189,7 +189,7 @@ QRect KCategorizedView::Private::visualRectInViewport(const QModelIndex &index) retRect.setTop(retRect.top() + (rowsInt * itemHeight) + - categoryDrawer->categoryHeight(listView->viewOptions()) + + categoryDrawer->categoryHeight(index, listView->viewOptions()) + listView->spacing() * 2); if (listView->gridSize().isEmpty()) @@ -273,7 +273,7 @@ QRect KCategorizedView::Private::visualCategoryRectInViewport(const QString &cat retRect.setTop(retRect.top() + (rowsInt * itemHeight) + - categoryDrawer->categoryHeight(listView->viewOptions()) + + categoryDrawer->categoryHeight(index, listView->viewOptions()) + listView->spacing() * 2); if (listView->gridSize().isEmpty()) @@ -283,7 +283,7 @@ QRect KCategorizedView::Private::visualCategoryRectInViewport(const QString &cat } } - retRect.setHeight(categoryDrawer->categoryHeight(listView->viewOptions())); + retRect.setHeight(categoryDrawer->categoryHeight(index, listView->viewOptions())); return retRect; } @@ -1102,7 +1102,7 @@ void KCategorizedView::mouseReleaseEvent(QMouseEvent *event) { if (d->categoryVisualRect(category).contains(event->pos())) { - QItemSelection selection; + QItemSelection selection = selectionModel()->selection(); QModelIndexList indexList = d->categoriesIndexes[category]; foreach (const QModelIndex &index, indexList) @@ -1112,7 +1112,7 @@ void KCategorizedView::mouseReleaseEvent(QMouseEvent *event) selection << QItemSelectionRange(selectIndex); } - selectionModel()->select(selection, QItemSelectionModel::Select); + selectionModel()->select(selection, QItemSelectionModel::SelectCurrent); break; }