Added ability to open context menu from inner media in service messages.

This commit is contained in:
23rd 2022-07-28 02:46:24 +03:00
parent de7f983aeb
commit d57e752ae9
1 changed files with 6 additions and 1 deletions

View File

@ -579,7 +579,12 @@ PointState Service::pointState(QPoint point) const {
g.setTop(g.top() + bar->height());
}
if (media) {
g.setHeight(g.height() - (st::msgServiceMargin.top() + media->height()));
const auto centerPadding = (g.width() - media->width()) / 2;
const auto r = g - QMargins(centerPadding, 0, centerPadding, 0);
if (!r.contains(point)) {
g.setHeight(g.height()
- (st::msgServiceMargin.top() + media->height()));
}
}
return g.contains(point) ? PointState::Inside : PointState::Outside;
}