qtui: Properly render hovered-upon clickables
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 24 Jul 2018 21:20:45 +0000 (23:20 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 28 Aug 2018 19:47:05 +0000 (21:47 +0200)
commit77f32bd74c6140060007ace39f70f2bbd8aeebe9
tree5acc53cfa0e33647405883892dc23eb695fafb18
parent670e7d401aae1196c0a24c59f96d267a8eb9d1bb
qtui: Properly render hovered-upon clickables

Additional formats given to QTextLayout::draw() are not cumulative.
Since we were using this feature for rendering both selections and
active (hovered-upon) clickables, things would break when both
overlapped. In particular, a highlighted *and* selected URL would
vanish while being hovered.

Fix this by explicitly calculating the range of affected formats
for both selections and active clickables, taking overlap into
account. Remove special handling in ContentsChatItem in favor of
the more generic solution.

Use the newly-introduced "hovered" message label to determine how
an active clickable should be rendered, rather than hardcoding
an underline.
src/qtui/chatitem.cpp
src/qtui/chatitem.h