mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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 st = context.st;
|
||||||
const auto sti = context.imageStyle();
|
const auto sti = context.imageStyle();
|
||||||
|
const auto &padding = st::purchasedTagPadding;
|
||||||
auto right = outer.x() + outer.width();
|
auto right = outer.x() + outer.width();
|
||||||
auto top = outer.y();
|
auto top = outer.y();
|
||||||
right -= st::msgDateImgDelta + st::msgDateImgPadding.x();
|
right -= st::msgDateImgDelta + padding.right();
|
||||||
top += st::msgDateImgDelta + st::msgDateImgPadding.y();
|
top += st::msgDateImgDelta + padding.top();
|
||||||
|
|
||||||
const auto size = QSize(
|
const auto size = QSize(
|
||||||
purchased->text.maxWidth(),
|
purchased->text.maxWidth(),
|
||||||
st::normalFont->height);
|
st::normalFont->height);
|
||||||
const auto tagX = right - size.width();
|
const auto tagX = right - size.width();
|
||||||
const auto tagY = top;
|
const auto tagY = top;
|
||||||
const auto tagW = size.width() + 2 * st::msgDateImgPadding.x();
|
const auto tagW = padding.left() + size.width() + padding.right();
|
||||||
const auto tagH = size.height() + 2 * st::msgDateImgPadding.y();
|
const auto tagH = padding.top() + size.height() + padding.bottom();
|
||||||
Ui::FillRoundRect(
|
Ui::FillRoundRect(
|
||||||
p,
|
p,
|
||||||
tagX - st::msgDateImgPadding.x(),
|
tagX - padding.left(),
|
||||||
tagY - st::msgDateImgPadding.y(),
|
tagY - padding.top(),
|
||||||
tagW,
|
tagW,
|
||||||
tagH,
|
tagH,
|
||||||
sti->msgDateImgBg,
|
sti->msgDateImgBg,
|
||||||
|
@ -268,7 +269,7 @@ void Media::drawPurchasedTag(
|
||||||
purchased->text.draw(p, {
|
purchased->text.draw(p, {
|
||||||
.position = { tagX, tagY },
|
.position = { tagX, tagY },
|
||||||
.outerWidth = width(),
|
.outerWidth = width(),
|
||||||
.availableWidth = tagW - 2 * st::msgDateImgPadding.x(),
|
.availableWidth = size.width(),
|
||||||
.palette = &st->priceTagTextPalette(),
|
.palette = &st->priceTagTextPalette(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1144,3 +1144,4 @@ factcheckField: InputField(defaultInputField) {
|
||||||
|
|
||||||
style: defaultTextStyle;
|
style: defaultTextStyle;
|
||||||
}
|
}
|
||||||
|
purchasedTagPadding: margins(3px, 2px, 6px, 2px);
|
||||||
|
|
|
@ -46,4 +46,4 @@ creditsBoxButtonLabel: FlatLabel(defaultFlatLabel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
starIconSmall: icon{{ "payments/small_star", windowFg }};
|
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