VCS History dialog: show commit message with clickable urls & fixed font
ClosedPublic

Authored by kossebau on Nov 19 2017, 4:34 PM.

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Nov 19 2017, 4:34 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptNov 19 2017, 4:34 PM

Before:


After:

brauch added a subscriber: brauch.Nov 19 2017, 4:40 PM

Very good to have somebody working on those dialogs, they really need some love. Thanks!

Only question is, do we really need KTextToHtml to just set a fixed font? Can we not simply set a fixed font as the font of the text browser?

kossebau added a comment.EditedNov 19 2017, 4:52 PM

Very good to have somebody working on those dialogs, they really need some love. Thanks!

Yes, they really feel strange, and possibly need a bigger overhaul in general, to match workflows (mines are not yet met). This is more a drive-by improvement while I look into getting the annotation delegate to show what I want :)

Only question is, do we really need KTextToHtml to just set a fixed font? Can we not simply set a fixed font as the font of the text browser?

Ehm, the KTextToHtml is used to transform all the urls into mark-uped hyperlinks, so QTextBrowser actually displays them as links (see https://api.kde.org/frameworks/kcoreaddons/html/namespaceKTextToHTML.html). Found this method when looking how KDE PIM's messagelib turns plain text into enriched HTML, which calls it.

And while passing in potential HTML text anway, the <tt> felt more normal, as it would spare the code to look-up the system UI font set for fixed-size fonts, incl. ensuring an update of the font if systemsettings change. So with this in mind, would you still prefer some setFont()?

BTW, in an utopian future there will be also text processor plugins which turn "BUG:xyz," "REVIEW:abc" & Co. into clickable links, perhaps even with enriched metadata pulled from the server.

kfunk accepted this revision.Nov 19 2017, 4:56 PM
kfunk added a subscriber: kfunk.

Very nice, thanks again!

kdevplatform/vcs/widgets/vcseventwidget.cpp
231

[&] -> []

This revision is now accepted and ready to land.Nov 19 2017, 4:56 PM
brauch accepted this revision.Nov 19 2017, 4:57 PM

Ah, alright. Thanks!

This revision was automatically updated to reflect the committed changes.