┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNate Graham <[email protected]>2019-03-02 06:00:34 -0700
committerNate Graham <[email protected]>2019-08-24 12:44:56 -0600
commit97f49347482519b9ad53b7596d7462e68b7c2e14 (patch)
tree385f8629148bcc28eca5713f92283638ed267482 /src
parent7a83a680a5cded3d6a3bdb48cf30bac38439977e (diff)
Middle-elide file/folder labels so the extension is always visible
Summary: This ensures that the filename extension is always visible, and also is just a nicer way to elide file and folder names in general. BUG: 404955 FIXED-IN: 19.12.0 Test Plan: Details view: {F6648784} Icons view with limited label height: {F6648785} Reviewers: #dolphin, #vdg, elvisangelaccio, GB_2 Reviewed By: #dolphin, #vdg, elvisangelaccio, GB_2 Subscribers: GB_2, ndavis, rooty, elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D19471
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/kstandarditemlistwidget.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp
index 15c01726f..296cd9bbb 100644
--- a/src/kitemviews/kstandarditemlistwidget.cpp
+++ b/src/kitemviews/kstandarditemlistwidget.cpp
@@ -1165,7 +1165,7 @@ void KStandardItemListWidget::updateIconsLayoutTextCache()
do {
QString lastTextLine = nameText.mid(line.textStart());
lastTextLine = m_customizedFontMetrics.elidedText(lastTextLine,
- Qt::ElideRight,
+ Qt::ElideMiddle,
elidingWidth);
const QString elidedText = nameText.left(line.textStart()) + lastTextLine;
nameTextInfo->staticText.setText(elidedText);
@@ -1221,7 +1221,7 @@ void KStandardItemListWidget::updateIconsLayoutTextCache()
textLine.setLineWidth(maxWidth);
requiredWidth = textLine.naturalTextWidth();
if (requiredWidth > maxWidth) {
- const QString elidedText = m_customizedFontMetrics.elidedText(text, Qt::ElideRight, maxWidth);
+ const QString elidedText = m_customizedFontMetrics.elidedText(text, Qt::ElideMiddle, maxWidth);
textInfo->staticText.setText(elidedText);
requiredWidth = m_customizedFontMetrics.width(elidedText);
} else if (role == "rating") {
@@ -1270,7 +1270,7 @@ void KStandardItemListWidget::updateCompactLayoutTextCache()
qreal requiredWidth = m_customizedFontMetrics.width(text);
if (requiredWidth > maxWidth) {
requiredWidth = maxWidth;
- const QString elidedText = m_customizedFontMetrics.elidedText(text, Qt::ElideRight, maxWidth);
+ const QString elidedText = m_customizedFontMetrics.elidedText(text, Qt::ElideMiddle, maxWidth);
textInfo->staticText.setText(elidedText);
}
@@ -1327,7 +1327,7 @@ void KStandardItemListWidget::updateDetailsLayoutTextCache()
}
if (requiredWidth > availableTextWidth) {
- text = m_customizedFontMetrics.elidedText(text, Qt::ElideRight, availableTextWidth);
+ text = m_customizedFontMetrics.elidedText(text, Qt::ElideMiddle, availableTextWidth);
requiredWidth = m_customizedFontMetrics.width(text);
}