Use larger unique gift preview.

This commit is contained in:
John Preston 2025-02-03 12:35:24 +04:00
parent 03aa05e4d2
commit 4cab699b04
2 changed files with 7 additions and 3 deletions

View file

@ -382,7 +382,8 @@ bool WebPageData::computeDefaultSmallMedia() const {
&& description.empty()
&& author.isEmpty()) {
return false;
} else if (!document
} else if (!uniqueGift
&& !document
&& photo
&& type != WebPageType::Photo
&& type != WebPageType::Document

View file

@ -496,7 +496,9 @@ auto UniqueGiftBg(
p.setPen(Qt::NoPen);
const auto webpreview = (media.get() != view->media());
const auto thickness = webpreview ? 0 : st::chatUniqueGiftBorder * 2;
const auto radius = st::msgServiceGiftBoxRadius - thickness;
const auto radius = webpreview
? st::roundRadiusLarge
: (st::msgServiceGiftBoxRadius - thickness);
const auto full = QRect(0, 0, media->width(), media->height());
const auto inner = full.marginsRemoved(
{ thickness, thickness, thickness, thickness });
@ -519,7 +521,8 @@ auto UniqueGiftBg(
const auto width = media->width();
const auto shift = width / 12;
const auto doubled = width + 2 * shift;
const auto outer = QRect(-shift, -shift, doubled, doubled);
const auto top = (webpreview ? 2 : 1) * (-shift);
const auto outer = QRect(-shift, top, doubled, doubled);
p.setClipRect(inner);
Ui::PaintPoints(
p,