Added button to media viewer for photo from sponsored messages.

This commit is contained in:
23rd 2024-08-15 00:32:37 +03:00
parent 79c8c5ec5d
commit 4f8e914d53
2 changed files with 5 additions and 2 deletions

View file

@ -258,6 +258,7 @@ QSize Photo::countCurrentSize(int newWidth) {
const auto enlargeOuter = 2 * st::historyPageEnlargeSkip + enlargeInner; const auto enlargeOuter = 2 * st::historyPageEnlargeSkip + enlargeInner;
const auto showEnlarge = (_parent->media() != this) const auto showEnlarge = (_parent->media() != this)
&& _parent->data()->media() && _parent->data()->media()
&& !_parent->data()->isSponsored()
&& _parent->data()->media()->webpage() && _parent->data()->media()->webpage()
&& _parent->data()->media()->webpage()->suggestEnlargePhoto() && _parent->data()->media()->webpage()->suggestEnlargePhoto()
&& (newWidth >= enlargeOuter) && (newWidth >= enlargeOuter)

View file

@ -1510,10 +1510,10 @@ void OverlayWidget::refreshSponsoredButtonGeometry() {
(controllerBottom // Duplicated in recountSkipTop(). (controllerBottom // Duplicated in recountSkipTop().
- ((_streamed && _streamed->controls) - ((_streamed && _streamed->controls)
? (_streamed->controls->height() ? (_streamed->controls->height()
+ st::mediaviewCaptionMargin.height()) + st::mediaviewCaptionPadding.bottom())
: 0) : 0)
- _sponsoredButton->height() - _sponsoredButton->height()
- st::mediaviewCaptionPadding.bottom())); - st::mediaviewCaptionMargin.height()));
Ui::SendPendingMoveResizeEvents(_sponsoredButton.get()); Ui::SendPendingMoveResizeEvents(_sponsoredButton.get());
} }
@ -3483,6 +3483,8 @@ void OverlayWidget::displayPhoto(
initStreaming(); initStreaming();
} }
initSponsoredButton();
refreshCaption(); refreshCaption();
_blurred = true; _blurred = true;