diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinitemcategorizer.cpp | 4 | ||||
| -rw-r--r-- | src/kcategorizedview.cpp | 6 | ||||
| -rw-r--r-- | src/kcategorizedview_p.h | 1 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/dolphinitemcategorizer.cpp b/src/dolphinitemcategorizer.cpp index e51f5f52f..d5c6d4e28 100644 --- a/src/dolphinitemcategorizer.cpp +++ b/src/dolphinitemcategorizer.cpp @@ -199,8 +199,8 @@ void DolphinItemCategorizer::drawCategory(const QModelIndex &index, QPainter *painter) const { QRect starRect = option.rect; - int iconSize = KIconLoader::global()->theme()->defaultSize(K3Icon::Small); + int iconSize = KIconLoader::global()->currentSize(K3Icon::Small); const QString category = categoryForItem(index, sortRole); QColor color = option.palette.color(QPalette::Text); @@ -366,7 +366,7 @@ void DolphinItemCategorizer::drawCategory(const QModelIndex &index, int DolphinItemCategorizer::categoryHeight(const QStyleOption &option) const { - int iconSize = KIconLoader::global()->theme()->defaultSize(K3Icon::Small); + int iconSize = KIconLoader::global()->currentSize(K3Icon::Small); return qMax(option.fontMetrics.height() + (iconSize / 4) * 2 + 2, iconSize + (iconSize / 4) * 2 + 2) /* 2 gradient */; } diff --git a/src/kcategorizedview.cpp b/src/kcategorizedview.cpp index d250c42c9..b07774157 100644 --- a/src/kcategorizedview.cpp +++ b/src/kcategorizedview.cpp @@ -83,7 +83,6 @@ KCategorizedView::Private::Private(KCategorizedView *listView) , isDragging(false) , dragLeftViewport(false) , proxyModel(0) - , lastIndex(QModelIndex()) { } @@ -388,6 +387,9 @@ void KCategorizedView::Private::drawNewCategory(const QModelIndex &index, void KCategorizedView::Private::updateScrollbars() { + // find the last index in the last category + QModelIndex lastIndex = categoriesIndexes.isEmpty() ? QModelIndex() : categoriesIndexes[categories.last()].last(); + int lastItemBottom = cachedRectIndex(lastIndex).top() + listView->spacing() + (listView->gridSize().isEmpty() ? 0 : listView->gridSize().height()) - listView->viewport()->height(); @@ -1243,8 +1245,6 @@ void KCategorizedView::rowsInsertedArtifficial(const QModelIndex &parent, qStableSort(indexList.begin(), indexList.end(), categoryLessThan); } - d->lastIndex = d->categoriesIndexes[d->categories[d->categories.count() - 1]][d->categoriesIndexes[d->categories[d->categories.count() - 1]].count() - 1]; - // Finally, fill data information of items situation. This will help when // trying to compute an item place in the viewport int i = 0; // position relative to the category beginning diff --git a/src/kcategorizedview_p.h b/src/kcategorizedview_p.h index 45d89aa21..1a8a7f376 100644 --- a/src/kcategorizedview_p.h +++ b/src/kcategorizedview_p.h @@ -154,7 +154,6 @@ public: // Attributes for speed reasons KSortFilterProxyModel *proxyModel; QModelIndexList sourceModelIndexList; // in source model - QModelIndex lastIndex; }; #endif // KCATEGORIZEDVIEW_P_H |
