svn path=/trunk/KDE/kdebase/apps/; revision=691574
QPainter *painter) const
{
QRect starRect = option.rect;
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);
const QString category = categoryForItem(index, sortRole);
QColor color = option.palette.color(QPalette::Text);
int DolphinItemCategorizer::categoryHeight(const QStyleOption &option) const
{
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 */;
}
return qMax(option.fontMetrics.height() + (iconSize / 4) * 2 + 2, iconSize + (iconSize / 4) * 2 + 2) /* 2 gradient */;
}
, isDragging(false)
, dragLeftViewport(false)
, proxyModel(0)
, isDragging(false)
, dragLeftViewport(false)
, proxyModel(0)
- , lastIndex(QModelIndex())
void KCategorizedView::Private::updateScrollbars()
{
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();
int lastItemBottom = cachedRectIndex(lastIndex).top() +
listView->spacing() + (listView->gridSize().isEmpty() ? 0 : listView->gridSize().height()) - listView->viewport()->height();
qStableSort(indexList.begin(), indexList.end(), categoryLessThan);
}
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
// 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
// Attributes for speed reasons
KSortFilterProxyModel *proxyModel;
QModelIndexList sourceModelIndexList; // in source model
// Attributes for speed reasons
KSortFilterProxyModel *proxyModel;
QModelIndexList sourceModelIndexList; // in source model
};
#endif // KCATEGORIZEDVIEW_P_H
};
#endif // KCATEGORIZEDVIEW_P_H