2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Use nice icons in resale gifts sorting.

This commit is contained in:
John Preston
2025-04-24 16:41:49 +04:00
parent 9583007769
commit f2b888f9ae
5 changed files with 63 additions and 6 deletions

View File

@@ -1078,12 +1078,23 @@ void PreviewWrap::paintEvent(QPaintEvent *e) {
}
[[nodiscard]] Text::String SortModeText(ResaleSort mode) {
if (mode == ResaleSort::Number) {
return ResaleTabText(tr::lng_gift_resale_number(tr::now));
} else if (mode == ResaleSort::Price) {
return ResaleTabText(tr::lng_gift_resale_price(tr::now));
}
return ResaleTabText(tr::lng_gift_resale_date(tr::now));
auto text = [&] {
if (mode == ResaleSort::Number) {
return Ui::Text::IconEmoji(&st::giftBoxResaleMiniNumber).append(
tr::lng_gift_resale_number(tr::now));
} else if (mode == ResaleSort::Price) {
return Ui::Text::IconEmoji(&st::giftBoxResaleMiniPrice).append(
tr::lng_gift_resale_price(tr::now));
}
return Ui::Text::IconEmoji(&st::giftBoxResaleMiniDate).append(
tr::lng_gift_resale_date(tr::now));
}();
auto result = Text::String();
result.setMarkedText(
st::semiboldTextStyle,
text,
kMarkupTextOptions);
return result;
}
struct ResaleTabs {