diff options
| author | Nate Graham <[email protected]> | 2019-02-12 12:21:34 -0700 |
|---|---|---|
| committer | Nate Graham <[email protected]> | 2019-02-17 14:07:28 -0700 |
| commit | cf2da56c5e76c168ffdcdf7e2bbbf3ae4f924f55 (patch) | |
| tree | bd2c764230728fc6fe94f23d51ea3b0b10b555d7 /src/dolphinviewcontainer.cpp | |
| parent | 36da6c7e3293f74ad560a39fff155606960c67c9 (diff) | |
Word-wrap KMessageWidget text
Summary:
Word-wrap KMessageWidget text to prevent the window from being widened
when the text is very long.
CCBUG: 404232
Only `CCBUG: ` because word wrap only works where QLabel detects a word boundary;
it will not wrap a string with no spaces or other word boundaries (e.g.
"aaaaaaaaaaaaaaaaaaaa...")
Test Plan:
- Create a new text file with a 300-character name that has spaces in it
- In the KMessageWidget's error message, the file name is wrapped at the word
boundaries
Reviewers: #dolphin, #frameworks, cfeck, elvisangelaccio
Reviewed By: #dolphin, cfeck, elvisangelaccio
Subscribers: elvisangelaccio, cfeck, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D18968
Diffstat (limited to 'src/dolphinviewcontainer.cpp')
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 767af64e1..4d808d023 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -312,6 +312,10 @@ void DolphinViewContainer::showMessage(const QString& msg, MessageType type) m_messageWidget->setText(msg); + // TODO: wrap at arbitrary character positions once QLabel can do this + // https://bugreports.qt.io/browse/QTBUG-1276 + m_messageWidget->setWordWrap(true); + switch (type) { case Information: m_messageWidget->setMessageType(KMessageWidget::Information); break; case Warning: m_messageWidget->setMessageType(KMessageWidget::Warning); break; |
