mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-11 01:10:13 +00:00
Fixed display of tooltip for date of stickers.
- Fixed #6426.
- Regression was introduced in b814c6307a
.
This commit is contained in:
parent
405ccb8580
commit
04617e4a12
@ -150,7 +150,7 @@ void UnwrappedMedia::drawSurrounding(
|
||||
const auto rightAction = _parent->displayRightAction();
|
||||
const auto fullRight = calculateFullRight(inner);
|
||||
auto fullBottom = height();
|
||||
if (rightAction ? true : needInfoDisplay()) {
|
||||
if (needInfoDisplay()) {
|
||||
_parent->drawInfo(
|
||||
p,
|
||||
fullRight,
|
||||
@ -217,13 +217,19 @@ PointState UnwrappedMedia::pointState(QPoint point) const {
|
||||
usex = width() - usex - usew;
|
||||
}
|
||||
|
||||
const auto datey = height() - st::msgDateImgPadding.y() * 2
|
||||
- st::msgDateFont->height;
|
||||
const auto usey = rightAligned ? 0 : (height() - _contentSize.height());
|
||||
const auto useh = rightAligned
|
||||
? std::max(
|
||||
_contentSize.height(),
|
||||
height() - st::msgDateImgPadding.y() * 2 - st::msgDateFont->height)
|
||||
? std::max(_contentSize.height(), datey)
|
||||
: _contentSize.height();
|
||||
const auto inner = QRect(usex, usey, usew, useh);
|
||||
|
||||
// Rectangle of date bubble.
|
||||
if (point.x() < calculateFullRight(inner) && point.y() > datey) {
|
||||
return PointState::Inside;
|
||||
}
|
||||
|
||||
return inner.contains(point) ? PointState::Inside : PointState::Outside;
|
||||
}
|
||||
|
||||
@ -358,6 +364,7 @@ QPoint UnwrappedMedia::calculateFastActionPosition(
|
||||
bool UnwrappedMedia::needInfoDisplay() const {
|
||||
return (_parent->data()->id < 0)
|
||||
|| (_parent->isUnderCursor())
|
||||
|| (_parent->displayRightAction())
|
||||
|| (_parent->hasOutLayout()
|
||||
&& !Adaptive::ChatWide()
|
||||
&& _content->alwaysShowOutTimestamp());
|
||||
|
Loading…
Reference in New Issue
Block a user