mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +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) {
|
||||
_price.setMarkedText(
|
||||
st::semiboldTextStyle,
|
||||
_delegate->star().append(QString::number(data.stars)),
|
||||
_delegate->star().append(' ' + QString::number(data.stars)),
|
||||
kMarkupTextOptions,
|
||||
_delegate->textContext());
|
||||
_userpic = !data.userpic
|
||||
|
@ -284,6 +284,10 @@ void GiftButton::paintEvent(QPaintEvent *e) {
|
|||
const auto twidth = font->width(text);
|
||||
const auto pos = position + QPoint(singlew - twidth, font->height);
|
||||
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.rotate(45.);
|
||||
p.translate(-pos);
|
||||
|
|
|
@ -253,6 +253,9 @@ object_ptr<Ui::RpWidget> InnerWidget::setupSharedMedia(
|
|||
|
||||
if (!_topic) {
|
||||
addStoriesButton(_peer, st::infoIconMediaStories);
|
||||
if (const auto user = _peer->asUser()) {
|
||||
addPeerGiftsButton(user, st::infoIconMediaGifts);
|
||||
}
|
||||
addSavedSublistButton(_peer, st::infoIconMediaSaved);
|
||||
}
|
||||
addMediaButton(MediaType::Photo, st::infoIconMediaPhoto);
|
||||
|
@ -264,7 +267,6 @@ object_ptr<Ui::RpWidget> InnerWidget::setupSharedMedia(
|
|||
addMediaButton(MediaType::GIF, st::infoIconMediaGif);
|
||||
if (const auto user = _peer->asUser()) {
|
||||
addCommonGroupsButton(user, st::infoIconMediaGroup);
|
||||
addPeerGiftsButton(user, st::infoIconMediaGifts);
|
||||
} else if (const auto channel = _peer->asChannel()) {
|
||||
addSimilarChannelsButton(channel, st::infoIconMediaChannel);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue