mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added button to media viewer for photo from sponsored messages.
This commit is contained in:
parent
79c8c5ec5d
commit
4f8e914d53
2 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue