X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/49fd5b1c4b57abd09babe33de0313b2789256515..b1c9b5126d:/src/dolphinfileitemdelegate.cpp diff --git a/src/dolphinfileitemdelegate.cpp b/src/dolphinfileitemdelegate.cpp index c0e032570..3fa05cbb5 100644 --- a/src/dolphinfileitemdelegate.cpp +++ b/src/dolphinfileitemdelegate.cpp @@ -42,13 +42,13 @@ void DolphinFileItemDelegate::paint(QPainter* painter, { if (m_hasMinimizedNameColumn && (index.column() == KDirModel::Name)) { QStyleOptionViewItemV4 opt(option); - + const QAbstractProxyModel* proxyModel = static_cast(index.model()); const KDirModel* dirModel = static_cast(proxyModel->sourceModel()); const QModelIndex dirIndex = proxyModel->mapToSource(index); const KFileItem item = dirModel->itemForIndex(dirIndex); if (!item.isNull()) { - const int width = nameColumnWidth(item.name(), opt); + const int width = nameColumnWidth(item.text(), opt); opt.rect.setWidth(width); } KFileItemDelegate::paint(painter, opt, index); @@ -61,7 +61,7 @@ int DolphinFileItemDelegate::nameColumnWidth(const QString& name, const QStyleOp { QFontMetrics fontMetrics(option.font); int width = option.decorationSize.width() + fontMetrics.width(name) + 16; - + const int defaultWidth = option.rect.width(); if ((defaultWidth > 0) && (defaultWidth < width)) { width = defaultWidth; @@ -69,4 +69,3 @@ int DolphinFileItemDelegate::nameColumnWidth(const QString& name, const QStyleOp return width; } -#include "dolphinfileitemdelegate.moc"