]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Elide the label text on the statusbar in the middle
authorAhmad Samir <a.samirh78@gmail.com>
Wed, 22 Nov 2017 01:18:01 +0000 (18:18 -0700)
committerNathaniel Graham <pointedstick@zoho.com>
Wed, 22 Nov 2017 01:19:36 +0000 (18:19 -0700)
Summary:
BUG: 387189

Currently the label text on the statusbar is elided in on the right, but that means that when the text gets elided the size of the file isn't shown.

The label text on the statusbar shows the file name, the mime type and the size; the name is already shown in the main window and the mimetype can usually be guessed from the icon or from the extension, so it's usually the size that the user wants to see on the statusbar.

Reviewers: #dolphin, ngraham, elvisangelaccio

Reviewed By: #dolphin, ngraham, elvisangelaccio

Subscribers: elvisangelaccio, ngraham, anthonyfieroni

Differential Revision: https://phabricator.kde.org/D8927

src/statusbar/dolphinstatusbar.cpp

index 9fc559eb75ce750a1003df5d3afdd49bfaa04e83..f3b6c7bdd4209e467afa5450c2e9dcee40081b0d 100644 (file)
@@ -323,7 +323,7 @@ void DolphinStatusBar::updateLabelText()
 
     // Set status bar text and elide it if too long
     QFontMetrics fontMetrics(m_label->font());
-    const QString elidedText = fontMetrics.elidedText(text, Qt::ElideRight, m_label->width());
+    const QString elidedText = fontMetrics.elidedText(text, Qt::ElideMiddle, m_label->width());
     m_label->setText(elidedText);
 
     // If the text has been elided, set the original text as tooltip