]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Set the font to italic for symbolic links before calculating the size
authorFrank Reininghaus <frank78ac@googlemail.com>
Sat, 16 May 2009 10:45:13 +0000 (10:45 +0000)
committerFrank Reininghaus <frank78ac@googlemail.com>
Sat, 16 May 2009 10:45:13 +0000 (10:45 +0000)
of the area which is made available to KFileItemDelegate::paint. Fixes
the problem that Dolphin truncates the names of some symbolic links if
the italic version of the font needs more space than the non-italic
one.

BUG: 183620
CCMAIL: fredrikh@kde.org

svn path=/trunk/KDE/kdebase/apps/; revision=968589

src/dolphinfileitemdelegate.cpp

index 3fa05cbb5f808f2e9c64e1328440454bab34d2eb..9be70647b074d62d0ffd915f44f6051d1625ff42 100644 (file)
@@ -48,6 +48,10 @@ void DolphinFileItemDelegate::paint(QPainter* painter,
         const QModelIndex dirIndex = proxyModel->mapToSource(index);
         const KFileItem item = dirModel->itemForIndex(dirIndex);
         if (!item.isNull()) {
+            // Symbolic links are displayed in an italic font
+            if (item.isLink())
+                opt.font.setItalic(true);
+
             const int width = nameColumnWidth(item.text(), opt);
             opt.rect.setWidth(width);
         }