From ef41878815bc151600bd8388faa9f545d520dea4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 2 Feb 2022 15:45:30 +0300 Subject: [PATCH] Fix date tooltip on outgoing messages. --- .../history/view/history_view_bottom_info.cpp | 10 +++++++--- .../history/view/history_view_bottom_info.h | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp index 50b1aa4ef9..43cddbd771 100644 --- a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp +++ b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp @@ -115,10 +115,15 @@ TextState BottomInfo::textState( result.link = link; return result; } + const auto textWidth = _authorEditedDate.maxWidth(); + auto withTicksWidth = textWidth; + if (_data.flags & (Data::Flag::OutLayout | Data::Flag::Sending)) { + withTicksWidth += st::historySendStateSpace; + } const auto inTime = QRect( - width() - _dateWidth, + width() - withTicksWidth, 0, - _dateWidth, + withTicksWidth, st::msgDateFont->height ).contains(position); if (inTime) { @@ -412,7 +417,6 @@ void BottomInfo::layoutDateText() { const auto author = _data.author; const auto prefix = !author.isEmpty() ? qsl(", ") : QString(); const auto date = edited + _data.date.toString(cTimeFormat()); - _dateWidth = st::msgDateFont->width(date); const auto afterAuthor = prefix + date; const auto afterAuthorWidth = st::msgDateFont->width(afterAuthor); const auto authorWidth = st::msgDateFont->width(author); diff --git a/Telegram/SourceFiles/history/view/history_view_bottom_info.h b/Telegram/SourceFiles/history/view/history_view_bottom_info.h index 62ad01f581..b9c370dfff 100644 --- a/Telegram/SourceFiles/history/view/history_view_bottom_info.h +++ b/Telegram/SourceFiles/history/view/history_view_bottom_info.h @@ -128,7 +128,6 @@ private: std::vector _reactions; mutable ClickHandlerPtr _revokeLink; int _reactionsMaxWidth = 0; - int _dateWidth = 0; bool _authorElided = false; };