┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2010-09-25 22:01:05 +0000
committerFrank Reininghaus <[email protected]>2010-09-25 22:01:05 +0000
commit732459f4e29707faaae63645ffe1aae31215e77e (patch)
treeb9e450bba811ce6d4bbdd27ee2507a573c6220c2
parentc5659d48b077f44738043c7933becd6a48c3a12e (diff)
Use KStringHandler::preProcessWrap() when calculating the width of a
file name in DolphinFileItemDelegate. This makes sure that zero width spaces (which prevent kerning) are added at the same places where KFileItemDelegate adds them when actually rendering the name. Fixes the problem that file names are elided and partly replaced by "..." even though there is enough space for the full name. CCBUG: 251121 svn path=/trunk/KDE/kdebase/apps/; revision=1179568
-rw-r--r--src/views/dolphinfileitemdelegate.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/views/dolphinfileitemdelegate.cpp b/src/views/dolphinfileitemdelegate.cpp
index 6b706c88b..609a12b98 100644
--- a/src/views/dolphinfileitemdelegate.cpp
+++ b/src/views/dolphinfileitemdelegate.cpp
@@ -23,6 +23,7 @@
#include <kfileitem.h>
#include <kicon.h>
#include <kiconloader.h>
+#include <kstringhandler.h>
#include <QAbstractItemModel>
#include <QAbstractProxyModel>
@@ -82,7 +83,7 @@ void DolphinFileItemDelegate::paint(QPainter* painter,
int DolphinFileItemDelegate::nameColumnWidth(const QString& name, const QStyleOptionViewItem& option)
{
QFontMetrics fontMetrics(option.font);
- int width = option.decorationSize.width() + fontMetrics.width(name) + 16;
+ int width = option.decorationSize.width() + fontMetrics.width(KStringHandler::preProcessWrap(name)) + 16;
const int defaultWidth = option.rect.width();
if ((defaultWidth > 0) && (defaultWidth < width)) {