X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/a5cf21ff06aff44cde563eaceae3c6cef452ee48..22b050a1d04e22097bc9d149e8e73b2d7fdfcdcc:/src/views/dolphinfileitemdelegate.cpp diff --git a/src/views/dolphinfileitemdelegate.cpp b/src/views/dolphinfileitemdelegate.cpp index 6b706c88b..64a19582a 100644 --- a/src/views/dolphinfileitemdelegate.cpp +++ b/src/views/dolphinfileitemdelegate.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -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)) { @@ -162,14 +163,32 @@ QPixmap DolphinFileItemDelegate::emblemForState(KVersionControlPlugin::VersionSt for (int i = KVersionControlPlugin::NormalVersion; i <= KVersionControlPlugin::ConflictingVersion; ++i) { QString iconName; switch (i) { - case KVersionControlPlugin::NormalVersion: iconName = "vcs-normal"; break; - case KVersionControlPlugin::UpdateRequiredVersion: iconName = "vcs-update-required"; break; - case KVersionControlPlugin::LocallyModifiedVersion: iconName = "vcs-locally-modified"; break; - case KVersionControlPlugin::AddedVersion: iconName = "vcs-added"; break; - case KVersionControlPlugin::RemovedVersion: iconName = "vcs-removed"; break; - case KVersionControlPlugin::ConflictingVersion: iconName = "vcs-conflicting"; break; + case KVersionControlPlugin::NormalVersion: + iconName = "vcs-normal"; + break; + case KVersionControlPlugin::UpdateRequiredVersion: + iconName = "vcs-update-required"; + break; + case KVersionControlPlugin::LocallyModifiedVersion: + iconName = "vcs-locally-modified"; + break; + case KVersionControlPlugin::LocallyModifiedUnstagedVersion: + iconName = "vcs-locally-modified-unstaged"; + break; + case KVersionControlPlugin::AddedVersion: + iconName = "vcs-added"; + break; + case KVersionControlPlugin::RemovedVersion: + iconName = "vcs-removed"; + break; + case KVersionControlPlugin::ConflictingVersion: + iconName = "vcs-conflicting"; + break; case KVersionControlPlugin::UnversionedVersion: - default: Q_ASSERT(false); break; + break; + default: + Q_ASSERT(false); + break; } m_cachedEmblems[i] = KIcon(iconName).pixmap(emblemSize);