X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.cpp;h=9fadc127a7612c84590af3ae377f142167a70f0e;hp=4da2bb47075b5ab0c9cde1490c51f5777e3b6f05;hb=00e1a9c29e792ba4d65dba21b7ba04131bcb13bc;hpb=b7447afe8e836376776dac26704e227a678d2913 diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index 4da2bb47..9fadc127 100644 --- a/src/qtui/chatitem.cpp +++ b/src/qtui/chatitem.cpp @@ -20,6 +20,9 @@ #include "chatitem.h" +#include +#include + #include #include #include @@ -286,36 +289,92 @@ void ChatItem::overlayFormat(UiStyle::FormatList &fmtList, quint16 start, quint1 QVector ChatItem::additionalFormats() const { - return selectionFormats(); -} + // Calculate formats to overlay (only) if there's a selection, and/or a hovered clickable + if (!hasSelection() && !hasActiveClickable()) { + return {}; + } + using Label = UiStyle::MessageLabel; + using Format = UiStyle::Format; -QVector ChatItem::selectionFormats() const -{ - if (!hasSelection()) - return QVector(); + Label itemLabel = data(ChatLineModel::MsgLabelRole).value