X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.cpp;h=bbd49bfc6c52483de95e8857bab6e9ca1b8d54b0;hb=7cf8b4e04ae10dd68d344444c49499d4f916394c;hp=4da2bb47075b5ab0c9cde1490c51f5777e3b6f05;hpb=b7447afe8e836376776dac26704e227a678d2913;p=quassel.git diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index 4da2bb47..bbd49bfc 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