D14469: KDevelop: word wrapping the problem text in the Problem Reporter (WIP)
René J.V. Bertin
noreply at phabricator.kde.org
Sun Jul 29 20:41:27 BST 2018
rjvbb created this revision.
rjvbb added a reviewer: KDevelop.
rjvbb added a project: KDevelop.
rjvbb requested review of this revision.
REVISION SUMMARY
This patch aims to introduce a "clever" way to wrap the message ("error") column in the Problem Reporter toolview, something that I have often missed (e.g. because of very long file messages).
Activating text wrapping isn't very difficult, getting the rows at the appropriate height isn't because I haven't been able to get a reliable indicator that text is indeed being wrapped (= displayed on more than a single line). I'm thus guessing it by comparing the standard delegate sizeHint to the width that will actually be used; if larger wrapping will result.
Ideally that rendering width will be the width selected by the user or else 2/3 of the toolview width (which works well for me but can be another value of course).
Annoyingly I haven't been able to figure out how to detect *user* induced changes to the column width (hence the approximation of waiting for the 1st column redraw). In addition, the delegate's sizeHint() method isn't re-called when the user is or has finished resizing the column.
Finally, the calculated height for wrapped text is sometimes a bit too low (or the sizeHint is ignored?) but is usually much too high initially when starting KDevelop with the Problem view open.
This is thus very much a work in process; I'm putting it here because I think it is potentially useful and hope to get a few nudges to get the glitches out of my code.
TEST PLAN
Apply patch and open any document where the parser gives diagnostic output.
One can set the default width to 1/3 of the toolview to cause wrapping in almost any text.
REPOSITORY
R32 KDevelop
REVISION DETAIL
https://phabricator.kde.org/D14469
AFFECTED FILES
plugins/problemreporter/problemtreeview.cpp
To: rjvbb, #kdevelop
Cc: kdevelop-devel, antismap, iodelay, vbspam, njensen, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180729/3c264271/attachment-0001.html>
More information about the KDevelop-devel
mailing list