Fix date tooltip on outgoing messages.

This commit is contained in:
John Preston 2022-02-02 15:45:30 +03:00
parent 6a663932f3
commit ef41878815
2 changed files with 7 additions and 4 deletions

View File

@ -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);

View File

@ -128,7 +128,6 @@ private:
std::vector<Reaction> _reactions;
mutable ClickHandlerPtr _revokeLink;
int _reactionsMaxWidth = 0;
int _dateWidth = 0;
bool _authorElided = false;
};