mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Added button to media viewer for photo from sponsored messages.
This commit is contained in:
@@ -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)
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user