mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Add premium promo section about wallpapers.
This commit is contained in:
parent
8c3fa14a75
commit
28d9330969
9 changed files with 30 additions and 2 deletions
|
@ -1945,6 +1945,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_premium_summary_subtitle_gift#other" = "{user} has gifted you a {count}-months subscription for Telegram Premium.";
|
||||
"lng_premium_summary_subtitle_gift_me#one" = "You gifted {user} a {count}-month subscription for Telegram Premium.";
|
||||
"lng_premium_summary_subtitle_gift_me#other" = "You gifted {user} a {count}-months subscription for Telegram Premium.";
|
||||
"lng_premium_summary_subtitle_wallpapers" = "Wallpapers for Both Sides";
|
||||
"lng_premium_summary_about_wallpapers" = "Set custom wallpapers for you and your chat partner.";
|
||||
"lng_premium_summary_subtitle_stories" = "Upgraded Stories";
|
||||
"lng_premium_summary_about_stories" = "Priority order, stealth mode, permanent views history and more.";
|
||||
"lng_premium_summary_subtitle_double_limits" = "Doubled Limits";
|
||||
|
@ -4135,6 +4137,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_view_button_request_join" = "Request to Join";
|
||||
"lng_view_button_external_link" = "Open link";
|
||||
"lng_view_button_boost" = "Boost";
|
||||
"lng_view_button_giftcode" = "Open";
|
||||
|
||||
"lng_sponsored_hide_ads" = "Hide";
|
||||
"lng_sponsored_title" = "What are sponsored messages?";
|
||||
|
|
|
@ -691,7 +691,7 @@ void BackgroundPreviewBox::applyForPeer() {
|
|||
} else {
|
||||
ShowPremiumPreviewBox(
|
||||
_controller->uiShow(),
|
||||
PremiumPreview::AnimatedEmoji);
|
||||
PremiumPreview::Wallpapers);
|
||||
}
|
||||
});
|
||||
const auto cancel = CreateChild<RoundButton>(
|
||||
|
|
|
@ -93,6 +93,8 @@ void PreloadSticker(const std::shared_ptr<Data::DocumentMedia> &media) {
|
|||
|
||||
[[nodiscard]] rpl::producer<QString> SectionTitle(PremiumPreview section) {
|
||||
switch (section) {
|
||||
case PremiumPreview::Wallpapers:
|
||||
return tr::lng_premium_summary_subtitle_wallpapers();
|
||||
case PremiumPreview::Stories:
|
||||
return tr::lng_premium_summary_subtitle_stories();
|
||||
case PremiumPreview::DoubleLimits:
|
||||
|
@ -127,6 +129,8 @@ void PreloadSticker(const std::shared_ptr<Data::DocumentMedia> &media) {
|
|||
|
||||
[[nodiscard]] rpl::producer<QString> SectionAbout(PremiumPreview section) {
|
||||
switch (section) {
|
||||
case PremiumPreview::Wallpapers:
|
||||
return tr::lng_premium_summary_about_wallpapers();
|
||||
case PremiumPreview::Stories:
|
||||
return tr::lng_premium_summary_about_stories();
|
||||
case PremiumPreview::DoubleLimits:
|
||||
|
@ -471,6 +475,7 @@ struct VideoPreviewDocument {
|
|||
case PremiumPreview::ProfileBadge: return "profile_badge";
|
||||
case PremiumPreview::AnimatedUserpics: return "animated_userpics";
|
||||
case PremiumPreview::RealTimeTranslation: return "translations";
|
||||
case PremiumPreview::Wallpapers: return "wallpapers";
|
||||
}
|
||||
return "";
|
||||
}();
|
||||
|
|
|
@ -60,6 +60,7 @@ enum class PremiumPreview {
|
|||
ProfileBadge,
|
||||
AnimatedUserpics,
|
||||
RealTimeTranslation,
|
||||
Wallpapers,
|
||||
|
||||
kCount,
|
||||
};
|
||||
|
|
|
@ -179,6 +179,8 @@ WebPageType ParseWebPageType(
|
|||
return WebPageType::BotApp;
|
||||
} else if (type == u"telegram_channel_boost"_q) {
|
||||
return WebPageType::ChannelBoost;
|
||||
} else if (type == u"telegram_giftcode"_q) {
|
||||
return WebPageType::Giftcode;
|
||||
} else if (hasIV) {
|
||||
return WebPageType::ArticleWithIV;
|
||||
} else {
|
||||
|
|
|
@ -27,6 +27,7 @@ enum class WebPageType : uint8 {
|
|||
Channel,
|
||||
ChannelWithRequest,
|
||||
ChannelBoost,
|
||||
Giftcode,
|
||||
|
||||
Photo,
|
||||
Video,
|
||||
|
|
|
@ -106,6 +106,8 @@ std::vector<std::unique_ptr<Data::Media>> PrepareCollageMedia(
|
|||
? tr::lng_view_button_request_join(tr::now)
|
||||
: (type == WebPageType::ChannelBoost)
|
||||
? tr::lng_view_button_boost(tr::now)
|
||||
: (type == WebPageType::Giftcode)
|
||||
? tr::lng_view_button_giftcode(tr::now)
|
||||
: (type == WebPageType::VoiceChat)
|
||||
? tr::lng_view_button_voice_chat(tr::now)
|
||||
: (type == WebPageType::Livestream)
|
||||
|
@ -125,6 +127,7 @@ std::vector<std::unique_ptr<Data::Media>> PrepareCollageMedia(
|
|||
|| (type == WebPageType::Group)
|
||||
|| (type == WebPageType::Channel)
|
||||
|| (type == WebPageType::ChannelBoost)
|
||||
|| (type == WebPageType::Giftcode)
|
||||
// || (type == WebPageType::Bot)
|
||||
|| (type == WebPageType::User)
|
||||
|| (type == WebPageType::VoiceChat)
|
||||
|
|
|
@ -77,6 +77,7 @@ settingsIconInterfaceScale: icon {{ "settings/interface_scale", settingsIconFg }
|
|||
settingsIconStickers: icon {{ "settings/stickers", settingsIconFg }};
|
||||
settingsIconEmoji: icon {{ "settings/emoji", settingsIconFg }};
|
||||
|
||||
settingsPremiumIconWallpapers: icon {{ "settings/photo", settingsIconFg }};
|
||||
settingsPremiumIconStories: icon {{ "settings/stories", settingsIconFg }};
|
||||
settingsPremiumIconChannelsOff: icon {{ "settings/premium/channels_off", settingsIconFg }};
|
||||
settingsPremiumIconDouble: icon {{ "settings/premium/double", settingsIconFg }};
|
||||
|
|
|
@ -176,6 +176,7 @@ using Order = std::vector<QString>;
|
|||
|
||||
[[nodiscard]] Order FallbackOrder() {
|
||||
return Order{
|
||||
u"wallpapers"_q,
|
||||
u"stories"_q,
|
||||
u"double_limits"_q,
|
||||
u"more_upload"_q,
|
||||
|
@ -195,6 +196,16 @@ using Order = std::vector<QString>;
|
|||
|
||||
[[nodiscard]] base::flat_map<QString, Entry> EntryMap() {
|
||||
return base::flat_map<QString, Entry>{
|
||||
{
|
||||
u"wallpapers"_q,
|
||||
Entry{
|
||||
&st::settingsPremiumIconWallpapers,
|
||||
tr::lng_premium_summary_subtitle_wallpapers(),
|
||||
tr::lng_premium_summary_about_wallpapers(),
|
||||
PremiumPreview::Wallpapers,
|
||||
true,
|
||||
},
|
||||
},
|
||||
{
|
||||
u"stories"_q,
|
||||
Entry{
|
||||
|
@ -202,7 +213,6 @@ using Order = std::vector<QString>;
|
|||
tr::lng_premium_summary_subtitle_stories(),
|
||||
tr::lng_premium_summary_about_stories(),
|
||||
PremiumPreview::Stories,
|
||||
true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -1660,6 +1670,8 @@ not_null<Ui::GradientButton*> CreateSubscribeButton(
|
|||
return PremiumPreview::AnimatedUserpics;
|
||||
} else if (s == u"translations"_q) {
|
||||
return PremiumPreview::RealTimeTranslation;
|
||||
} else if (s == u"wallpapers"_q) {
|
||||
return PremiumPreview::Wallpapers;
|
||||
}
|
||||
return PremiumPreview::kCount;
|
||||
}) | ranges::views::filter([](PremiumPreview type) {
|
||||
|
|
Loading…
Add table
Reference in a new issue