mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Make purchased media badge better looking.
This commit is contained in:
parent
b58c03f0de
commit
c833b8a1b0
3 changed files with 10 additions and 8 deletions
|
@ -243,22 +243,23 @@ void Media::drawPurchasedTag(
|
|||
|
||||
const auto st = context.st;
|
||||
const auto sti = context.imageStyle();
|
||||
const auto &padding = st::purchasedTagPadding;
|
||||
auto right = outer.x() + outer.width();
|
||||
auto top = outer.y();
|
||||
right -= st::msgDateImgDelta + st::msgDateImgPadding.x();
|
||||
top += st::msgDateImgDelta + st::msgDateImgPadding.y();
|
||||
right -= st::msgDateImgDelta + padding.right();
|
||||
top += st::msgDateImgDelta + padding.top();
|
||||
|
||||
const auto size = QSize(
|
||||
purchased->text.maxWidth(),
|
||||
st::normalFont->height);
|
||||
const auto tagX = right - size.width();
|
||||
const auto tagY = top;
|
||||
const auto tagW = size.width() + 2 * st::msgDateImgPadding.x();
|
||||
const auto tagH = size.height() + 2 * st::msgDateImgPadding.y();
|
||||
const auto tagW = padding.left() + size.width() + padding.right();
|
||||
const auto tagH = padding.top() + size.height() + padding.bottom();
|
||||
Ui::FillRoundRect(
|
||||
p,
|
||||
tagX - st::msgDateImgPadding.x(),
|
||||
tagY - st::msgDateImgPadding.y(),
|
||||
tagX - padding.left(),
|
||||
tagY - padding.top(),
|
||||
tagW,
|
||||
tagH,
|
||||
sti->msgDateImgBg,
|
||||
|
@ -268,7 +269,7 @@ void Media::drawPurchasedTag(
|
|||
purchased->text.draw(p, {
|
||||
.position = { tagX, tagY },
|
||||
.outerWidth = width(),
|
||||
.availableWidth = tagW - 2 * st::msgDateImgPadding.x(),
|
||||
.availableWidth = size.width(),
|
||||
.palette = &st->priceTagTextPalette(),
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1144,3 +1144,4 @@ factcheckField: InputField(defaultInputField) {
|
|||
|
||||
style: defaultTextStyle;
|
||||
}
|
||||
purchasedTagPadding: margins(3px, 2px, 6px, 2px);
|
||||
|
|
|
@ -46,4 +46,4 @@ creditsBoxButtonLabel: FlatLabel(defaultFlatLabel) {
|
|||
}
|
||||
|
||||
starIconSmall: icon{{ "payments/small_star", windowFg }};
|
||||
starIconSmallPadding: margins(0px, -3px, 0px, 0px);
|
||||
starIconSmallPadding: margins(0px, -2px, 0px, 0px);
|
||||
|
|
Loading…
Add table
Reference in a new issue