mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-22 10:17:10 +00:00
Improve posts search transaction entry view.
This commit is contained in:
parent
5473696491
commit
bf0b85afd1
@ -2902,6 +2902,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
"lng_credits_box_history_entry_ads" = "Ads Platform";
|
"lng_credits_box_history_entry_ads" = "Ads Platform";
|
||||||
"lng_credits_box_history_entry_premium_bot" = "Stars Top-Up";
|
"lng_credits_box_history_entry_premium_bot" = "Stars Top-Up";
|
||||||
"lng_credits_box_history_entry_currency_in" = "TON Top-Up";
|
"lng_credits_box_history_entry_currency_in" = "TON Top-Up";
|
||||||
|
"lng_credits_box_history_entry_posts_search" = "Posts Search";
|
||||||
"lng_credits_box_history_entry_api" = "Paid Broadcast";
|
"lng_credits_box_history_entry_api" = "Paid Broadcast";
|
||||||
"lng_credits_box_history_entry_floodskip_about#one" = "{count} Message";
|
"lng_credits_box_history_entry_floodskip_about#one" = "{count} Message";
|
||||||
"lng_credits_box_history_entry_floodskip_about#other" = "{count} Messages";
|
"lng_credits_box_history_entry_floodskip_about#other" = "{count} Messages";
|
||||||
|
@ -153,6 +153,7 @@ Data::CreditsHistoryEntry CreditsHistoryEntryFromTL(
|
|||||||
.floodSkip = int(tl.data().vfloodskip_number().value_or(0)),
|
.floodSkip = int(tl.data().vfloodskip_number().value_or(0)),
|
||||||
.converted = stargift && incoming,
|
.converted = stargift && incoming,
|
||||||
.stargift = stargift.has_value(),
|
.stargift = stargift.has_value(),
|
||||||
|
.postsSearch = tl.data().is_posts_search(),
|
||||||
.giftUpgraded = tl.data().is_stargift_upgrade(),
|
.giftUpgraded = tl.data().is_stargift_upgrade(),
|
||||||
.giftResale = tl.data().is_stargift_resale(),
|
.giftResale = tl.data().is_stargift_resale(),
|
||||||
.reaction = tl.data().is_reaction(),
|
.reaction = tl.data().is_reaction(),
|
||||||
|
@ -1674,7 +1674,8 @@ void AddCreditsHistoryEntryTable(
|
|||||||
show,
|
show,
|
||||||
peerId);
|
peerId);
|
||||||
}
|
}
|
||||||
if (actorId || (!entry.starrefCommission && peerId)) {
|
if (!entry.postsSearch
|
||||||
|
&& (actorId || (!entry.starrefCommission && peerId))) {
|
||||||
auto text = entry.starrefCommission
|
auto text = entry.starrefCommission
|
||||||
? tr::lng_credits_box_history_entry_referred()
|
? tr::lng_credits_box_history_entry_referred()
|
||||||
: entry.in
|
: entry.in
|
||||||
|
@ -98,6 +98,7 @@ struct CreditsHistoryEntry final {
|
|||||||
bool converted : 1 = false;
|
bool converted : 1 = false;
|
||||||
bool anonymous : 1 = false;
|
bool anonymous : 1 = false;
|
||||||
bool stargift : 1 = false;
|
bool stargift : 1 = false;
|
||||||
|
bool postsSearch : 1 = false;
|
||||||
bool giftTransferred : 1 = false;
|
bool giftTransferred : 1 = false;
|
||||||
bool giftRefunded : 1 = false;
|
bool giftRefunded : 1 = false;
|
||||||
bool giftUpgraded : 1 = false;
|
bool giftUpgraded : 1 = false;
|
||||||
|
@ -868,7 +868,6 @@ postsSearchIntroFooter: FlatLabel(defaultFlatLabel) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
postsSearchIntroFooterMargin: margins(20px, 12px, 20px, 0px);
|
postsSearchIntroFooterMargin: margins(20px, 12px, 20px, 0px);
|
||||||
|
|
||||||
postsSearchIcon: icon {{ "box_search", windowFgActive }};
|
postsSearchIcon: icon {{ "box_search", windowFgActive }};
|
||||||
postsSearchIconPadding: margins(12px, 1px, 6px, 0px);
|
postsSearchIconPadding: margins(12px, 1px, 6px, 0px);
|
||||||
postsSearchArrow: icon {{ "dialogs/mini_arrow", windowFgActive }};
|
postsSearchArrow: icon {{ "dialogs/mini_arrow", windowFgActive }};
|
||||||
|
@ -887,6 +887,8 @@ void CreditsRow::init() {
|
|||||||
tr::now,
|
tr::now,
|
||||||
lt_count,
|
lt_count,
|
||||||
_entry.paidMessagesCount)
|
_entry.paidMessagesCount)
|
||||||
|
: _entry.postsSearch
|
||||||
|
? tr::lng_credits_box_history_entry_posts_search(tr::now)
|
||||||
: ((!_entry.subscriptionUntil.isNull() && !isSpecial)
|
: ((!_entry.subscriptionUntil.isNull() && !isSpecial)
|
||||||
|| (_entry.giftUpgraded && !isSpecial)
|
|| (_entry.giftUpgraded && !isSpecial)
|
||||||
|| (_entry.giftResale && !isSpecial)
|
|| (_entry.giftResale && !isSpecial)
|
||||||
@ -997,14 +999,9 @@ void CreditsRow::init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!_paintUserpicCallback) {
|
if (!_paintUserpicCallback) {
|
||||||
_paintUserpicCallback = /*_entry.stargift
|
_paintUserpicCallback = (isSpecial || _entry.postsSearch)
|
||||||
? Ui::GenerateGiftStickerUserpicCallback(
|
? Ui::GenerateCreditsPaintUserpicCallback(_entry)
|
||||||
_session,
|
: PeerListRow::generatePaintUserpicCallback(false);
|
||||||
_entry.bareGiftStickerId,
|
|
||||||
_context.repaint)
|
|
||||||
: */!isSpecial
|
|
||||||
? PeerListRow::generatePaintUserpicCallback(false)
|
|
||||||
: Ui::GenerateCreditsPaintUserpicCallback(_entry);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1282,7 +1282,10 @@ void GenericCreditsEntryBox(
|
|||||||
content->add(object_ptr<Ui::CenterWrap<>>(
|
content->add(object_ptr<Ui::CenterWrap<>>(
|
||||||
content,
|
content,
|
||||||
GenericEntryPhoto(content, callback, stUser.photoSize)));
|
GenericEntryPhoto(content, callback, stUser.photoSize)));
|
||||||
} else if (peer && !e.gift && !e.premiumMonthsForStars) {
|
} else if (peer
|
||||||
|
&& !e.gift
|
||||||
|
&& !e.premiumMonthsForStars
|
||||||
|
&& !e.postsSearch) {
|
||||||
if (e.subscriptionUntil.isNull() && s.until.isNull()) {
|
if (e.subscriptionUntil.isNull() && s.until.isNull()) {
|
||||||
content->add(object_ptr<Ui::CenterWrap<>>(
|
content->add(object_ptr<Ui::CenterWrap<>>(
|
||||||
content,
|
content,
|
||||||
@ -1368,7 +1371,7 @@ void GenericCreditsEntryBox(
|
|||||||
? st::creditsHistoryEntryStarGiftSkip
|
? st::creditsHistoryEntryStarGiftSkip
|
||||||
: st::creditsHistoryEntryGiftStickerSkip);
|
: st::creditsHistoryEntryGiftStickerSkip);
|
||||||
}, icon->lifetime());
|
}, icon->lifetime());
|
||||||
} else {
|
} else if (!e.postsSearch) {
|
||||||
const auto widget = content->add(
|
const auto widget = content->add(
|
||||||
object_ptr<Ui::CenterWrap<>>(
|
object_ptr<Ui::CenterWrap<>>(
|
||||||
content,
|
content,
|
||||||
@ -1405,6 +1408,8 @@ void GenericCreditsEntryBox(
|
|||||||
tr::now,
|
tr::now,
|
||||||
lt_count,
|
lt_count,
|
||||||
e.paidMessagesCount)
|
e.paidMessagesCount)
|
||||||
|
: e.postsSearch
|
||||||
|
? tr::lng_credits_box_history_entry_posts_search(tr::now)
|
||||||
: e.premiumMonthsForStars
|
: e.premiumMonthsForStars
|
||||||
? tr::lng_premium_summary_title(tr::now)
|
? tr::lng_premium_summary_title(tr::now)
|
||||||
: !e.title.isEmpty()
|
: !e.title.isEmpty()
|
||||||
|
@ -99,6 +99,7 @@ tonIconEmojiInSmall: IconEmoji(tonIconEmoji) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
creditsHistoryEntryTypeAds: icon {{ "folders/folders_channels", premiumButtonFg }};
|
creditsHistoryEntryTypeAds: icon {{ "folders/folders_channels", premiumButtonFg }};
|
||||||
|
creditsHistorySearchPostsIcon: icon {{ "box_search", historyPeerUserpicFg }};
|
||||||
|
|
||||||
creditsHistoryEntryGiftStickerSkip: -20px;
|
creditsHistoryEntryGiftStickerSkip: -20px;
|
||||||
creditsHistoryEntryGiftStickerSize: 150px;
|
creditsHistoryEntryGiftStickerSize: 150px;
|
||||||
|
@ -223,6 +223,12 @@ PaintRoundImageCallback GenerateCreditsPaintUserpicCallback(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
const auto bg = [&]() -> EmptyUserpic::BgColors {
|
const auto bg = [&]() -> EmptyUserpic::BgColors {
|
||||||
|
if (entry.postsSearch) {
|
||||||
|
return {
|
||||||
|
st::historyPeerSavedMessagesBg,
|
||||||
|
st::historyPeerSavedMessagesBg2,
|
||||||
|
};
|
||||||
|
}
|
||||||
switch (entry.peerType) {
|
switch (entry.peerType) {
|
||||||
case Data::CreditsHistoryEntry::PeerType::API:
|
case Data::CreditsHistoryEntry::PeerType::API:
|
||||||
return { st::historyPeer2UserpicBg, st::historyPeer2UserpicBg2 };
|
return { st::historyPeer2UserpicBg, st::historyPeer2UserpicBg2 };
|
||||||
@ -306,7 +312,9 @@ PaintRoundImageCallback GenerateCreditsPaintUserpicCallback(
|
|||||||
return [=](Painter &p, int x, int y, int outerWidth, int size) mutable {
|
return [=](Painter &p, int x, int y, int outerWidth, int size) mutable {
|
||||||
userpic->paintCircle(p, x, y, outerWidth, size);
|
userpic->paintCircle(p, x, y, outerWidth, size);
|
||||||
const auto rect = QRect(x, y, size, size);
|
const auto rect = QRect(x, y, size, size);
|
||||||
((entry.peerType == PeerType::AppStore)
|
(entry.postsSearch
|
||||||
|
? st::creditsHistorySearchPostsIcon
|
||||||
|
: (entry.peerType == PeerType::AppStore)
|
||||||
? st::sessionIconiPhone
|
? st::sessionIconiPhone
|
||||||
: (entry.peerType == PeerType::PlayMarket)
|
: (entry.peerType == PeerType::PlayMarket)
|
||||||
? st::sessionIconAndroid
|
? st::sessionIconAndroid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user