mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Improve gifts layout a bit.
This commit is contained in:
parent
e57742e7de
commit
fdf826b686
2 changed files with 8 additions and 2 deletions
|
@ -82,7 +82,7 @@ void GiftButton::setDescriptor(const GiftDescriptor &descriptor) {
|
||||||
}, [&](const GiftTypeStars &data) {
|
}, [&](const GiftTypeStars &data) {
|
||||||
_price.setMarkedText(
|
_price.setMarkedText(
|
||||||
st::semiboldTextStyle,
|
st::semiboldTextStyle,
|
||||||
_delegate->star().append(QString::number(data.stars)),
|
_delegate->star().append(' ' + QString::number(data.stars)),
|
||||||
kMarkupTextOptions,
|
kMarkupTextOptions,
|
||||||
_delegate->textContext());
|
_delegate->textContext());
|
||||||
_userpic = !data.userpic
|
_userpic = !data.userpic
|
||||||
|
@ -284,6 +284,10 @@ void GiftButton::paintEvent(QPaintEvent *e) {
|
||||||
const auto twidth = font->width(text);
|
const auto twidth = font->width(text);
|
||||||
const auto pos = position + QPoint(singlew - twidth, font->height);
|
const auto pos = position + QPoint(singlew - twidth, font->height);
|
||||||
p.save();
|
p.save();
|
||||||
|
const auto rubberOut = _extend.top();
|
||||||
|
const auto inner = rect().marginsRemoved(_extend);
|
||||||
|
p.setClipRect(inner.marginsAdded(
|
||||||
|
{ rubberOut, rubberOut, rubberOut, rubberOut }));
|
||||||
p.translate(pos);
|
p.translate(pos);
|
||||||
p.rotate(45.);
|
p.rotate(45.);
|
||||||
p.translate(-pos);
|
p.translate(-pos);
|
||||||
|
|
|
@ -253,6 +253,9 @@ object_ptr<Ui::RpWidget> InnerWidget::setupSharedMedia(
|
||||||
|
|
||||||
if (!_topic) {
|
if (!_topic) {
|
||||||
addStoriesButton(_peer, st::infoIconMediaStories);
|
addStoriesButton(_peer, st::infoIconMediaStories);
|
||||||
|
if (const auto user = _peer->asUser()) {
|
||||||
|
addPeerGiftsButton(user, st::infoIconMediaGifts);
|
||||||
|
}
|
||||||
addSavedSublistButton(_peer, st::infoIconMediaSaved);
|
addSavedSublistButton(_peer, st::infoIconMediaSaved);
|
||||||
}
|
}
|
||||||
addMediaButton(MediaType::Photo, st::infoIconMediaPhoto);
|
addMediaButton(MediaType::Photo, st::infoIconMediaPhoto);
|
||||||
|
@ -264,7 +267,6 @@ object_ptr<Ui::RpWidget> InnerWidget::setupSharedMedia(
|
||||||
addMediaButton(MediaType::GIF, st::infoIconMediaGif);
|
addMediaButton(MediaType::GIF, st::infoIconMediaGif);
|
||||||
if (const auto user = _peer->asUser()) {
|
if (const auto user = _peer->asUser()) {
|
||||||
addCommonGroupsButton(user, st::infoIconMediaGroup);
|
addCommonGroupsButton(user, st::infoIconMediaGroup);
|
||||||
addPeerGiftsButton(user, st::infoIconMediaGifts);
|
|
||||||
} else if (const auto channel = _peer->asChannel()) {
|
} else if (const auto channel = _peer->asChannel()) {
|
||||||
addSimilarChannelsButton(channel, st::infoIconMediaChannel);
|
addSimilarChannelsButton(channel, st::infoIconMediaChannel);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue