Chatline/widget should make use of QFontMetrics::elidedText
Each chatline consists of three parts separated by 2 invisible sliders:
Timestamp, Sender/Nick, Text
For the time beeing the Sender is chopped of at the beginning if there is not enough space to display the whole nick. Nicks are easier to identify if the end is missing rather then the beginning and it should be indicated that they are chopped by the use of an ellipse.
QFontMetrics::elidedText takes care of this problem.
I wanted to fix this myself but honestly... the chatwidget/chatline could use a refactoring themselves...
#1 Updated by Sputnick over 15 years ago
Well, code probably needs to go into ChatLine::draw(). Right now, we allow for changing text formats in the sender column (as in the normal message text as well), which does not allow for simply using elidedText. Easy fix would be to only allow one format for the column (which we have right now anyway) and just output the string using elidedText. If we, instead, like to keep the flexibility we have now, we'd have to compute this ourselves (which should not be too hard either).
#2 Updated by Sputnick over 14 years ago
Nowadays I'd favor a gradient or something more pretty than an ellipse.
#3 Updated by Sputnick over 14 years ago
We now have a gradient (rather than an ellipsis). ChatView can cut off senders both front and back, depending on a yet unconfigurable setting (ChatScene::setSenderCutoffMode()).