Bug 249638

Summary: Status bar text not elided on insufficient horizontal space
Product: [Applications] dolphin Reporter: Eike Hein <hein>
Component: generalAssignee: Peter Penz <peter.penz19>
Status: RESOLVED FIXED    
Severity: normal CC: markg85, Wolfgang_Mader
Priority: NOR Keywords: junior-jobs
Version: 16.12.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 4.9.0
Attachments: Dolphin status bar with text cut off
Proposed patch

Description Eike Hein 2010-08-31 16:14:05 UTC
Created attachment 51143 [details]
Dolphin status bar with text cut off

When the window is too narrow, the status bar text gets cut off rather than being elided (see attached screenshot). The fix would be to use a KSqueezedTextLabel.
Comment 1 Eike Hein 2010-08-31 16:14:28 UTC
Forgot to mention: Screenshot is of Dolphin from KDE SC 4.5.1.
Comment 2 Mark 2010-09-06 21:26:22 UTC
This isn't as easy as it sounds. I just gave it a try and simply replacing : m_messageLabel = new KonqStatusBarMessageLabel(this);
by
m_messageLabel = new KSqueezedTextLabel(this);

(in dolphinstatusbar.cpp) isn't possible. That is with some other edits like header file etc...

When compiling it misses functions that KonqStatusBarMessageLabel provides, but KSqueezedTextLabel doesn't. Like:

::setDefaultText
::defaultText
::type
::setMessage

Subclassing KSqueezedTextLabel is possible.

What's your suggestion?
Comment 3 Wolfgang Mader 2012-02-19 21:36:51 UTC
Created attachment 68937 [details]
Proposed patch
Comment 4 Wolfgang Mader 2012-02-19 21:39:03 UTC
In respones to Comment #3.

The patch introduces elided plain text messeges for KonqStatusBarMessageLabel.

P.s.: I neven manage to post a comment and an attachment at the same time.
Comment 5 Peter Penz 2012-02-20 14:49:43 UTC
Thanks Wolfgang for the patch! Sadly it does not work for texts that span multiple lines (e.g. when an error-message is shown).

I hope I can do it in time, but for 4.9 I planned to get rid of showing multiline-error-messages in the statusbar, so that your patch can be applied then. I'd suggest that we wait until I committed those changes so that there won't be a need to handle the multiline-case.
Comment 6 Wolfgang Mader 2012-02-20 15:07:56 UTC
In deed there is a flaw for multi line error messages. They get elided, but the height of the widget is increased without being used.

Since this is a general purpose widget, do you think mutli line messages can be neglected? The same question applies for rich text messages.
Comment 7 Peter Penz 2012-02-20 15:10:03 UTC
Yep, I'd say this widget should be simplified in a way that multiline messages are definitely not supported. Practically it is only used by Konqueror and Dolphin, so such a behavior change should not result in big troubles.
Comment 8 Peter Penz 2012-04-12 22:11:59 UTC
Git commit 213450d39704fc0154da5f0e45e4198af8239842 by Peter Penz.
Committed on 12/04/2012 at 23:57.
Pushed by ppenz into branch 'master'.

Use KMessageWidget for error- and information-messages

See http://agateau.com/2011/04/21/kde-ux-2011/ for more details.
This simplifies the statusbar in Dolphin a lot and allows to
do a proper eliding in case if status-messages are too long: In
this case a tooltip will show the whole status-message (thanks
to Wolfgang Mader for the initial patch!).

There is still missing some finetuning but the general approach
seems to work quite nice.
Related: bug 245618, bug 146533
FIXED-IN: 4.9.0

M  +14   -20   dolphin/src/dolphinmainwindow.cpp
M  +2    -2    dolphin/src/dolphinnewfilemenu.cpp
M  +79   -51   dolphin/src/dolphinviewcontainer.cpp
M  +28   -10   dolphin/src/dolphinviewcontainer.h
M  +93   -152  dolphin/src/statusbar/dolphinstatusbar.cpp
M  +32   -65   dolphin/src/statusbar/dolphinstatusbar.h
M  +9    -9    dolphin/src/statusbar/statusbarspaceinfo.cpp
M  +4    -2    dolphin/src/statusbar/statusbarspaceinfo.h

http://commits.kde.org/kde-baseapps/213450d39704fc0154da5f0e45e4198af8239842