mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Use larger unique gift preview.
This commit is contained in:
parent
03aa05e4d2
commit
4cab699b04
2 changed files with 7 additions and 3 deletions
|
@ -382,7 +382,8 @@ bool WebPageData::computeDefaultSmallMedia() const {
|
||||||
&& description.empty()
|
&& description.empty()
|
||||||
&& author.isEmpty()) {
|
&& author.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
} else if (!document
|
} else if (!uniqueGift
|
||||||
|
&& !document
|
||||||
&& photo
|
&& photo
|
||||||
&& type != WebPageType::Photo
|
&& type != WebPageType::Photo
|
||||||
&& type != WebPageType::Document
|
&& type != WebPageType::Document
|
||||||
|
|
|
@ -496,7 +496,9 @@ auto UniqueGiftBg(
|
||||||
p.setPen(Qt::NoPen);
|
p.setPen(Qt::NoPen);
|
||||||
const auto webpreview = (media.get() != view->media());
|
const auto webpreview = (media.get() != view->media());
|
||||||
const auto thickness = webpreview ? 0 : st::chatUniqueGiftBorder * 2;
|
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 full = QRect(0, 0, media->width(), media->height());
|
||||||
const auto inner = full.marginsRemoved(
|
const auto inner = full.marginsRemoved(
|
||||||
{ thickness, thickness, thickness, thickness });
|
{ thickness, thickness, thickness, thickness });
|
||||||
|
@ -519,7 +521,8 @@ auto UniqueGiftBg(
|
||||||
const auto width = media->width();
|
const auto width = media->width();
|
||||||
const auto shift = width / 12;
|
const auto shift = width / 12;
|
||||||
const auto doubled = width + 2 * shift;
|
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);
|
p.setClipRect(inner);
|
||||||
Ui::PaintPoints(
|
Ui::PaintPoints(
|
||||||
p,
|
p,
|
||||||
|
|
Loading…
Add table
Reference in a new issue