Added correspond premium feature premium box in edit peer color box.

This commit is contained in:
23rd
2025-10-27 20:06:17 +03:00
parent de5e1b3452
commit 02fafde09d
4 changed files with 17 additions and 15 deletions
+2 -1
View File
@@ -992,7 +992,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_color_emoji_off" = "Off"; "lng_settings_color_emoji_off" = "Off";
"lng_settings_color_emoji_about" = "Make replies to your messages stand out by adding custom patterns to them."; "lng_settings_color_emoji_about" = "Make replies to your messages stand out by adding custom patterns to them.";
"lng_settings_color_emoji_about_channel" = "Select an icon to create a custom pattern for replies to your messages."; "lng_settings_color_emoji_about_channel" = "Select an icon to create a custom pattern for replies to your messages.";
"lng_settings_color_subscribe" = "Subscribe to {link} to choose a custom color for your name.";
"lng_settings_color_changed" = "Your name color has been updated!"; "lng_settings_color_changed" = "Your name color has been updated!";
"lng_settings_color_changed_channel" = "Your channel color has been updated!"; "lng_settings_color_changed_channel" = "Your channel color has been updated!";
"lng_settings_color_changed_profile" = "Your profile style has been updated!"; "lng_settings_color_changed_profile" = "Your profile style has been updated!";
@@ -2769,6 +2768,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_premium_summary_about_filter_tags" = "Display folder names for each chat in the chat list."; "lng_premium_summary_about_filter_tags" = "Display folder names for each chat in the chat list.";
"lng_premium_summary_subtitle_todo_lists" = "Checklists"; "lng_premium_summary_subtitle_todo_lists" = "Checklists";
"lng_premium_summary_about_todo_lists" = "Plan, assign, and complete tasks - seamlessly and efficiently."; "lng_premium_summary_about_todo_lists" = "Plan, assign, and complete tasks - seamlessly and efficiently.";
"lng_premium_summary_subtitle_peer_colors" = "Name and Profile Colors";
"lng_premium_summary_about_peer_colors" = "Choose a color and logo for your profile and replies to your messages.";
"lng_premium_summary_bottom_subtitle" = "About Telegram Premium"; "lng_premium_summary_bottom_subtitle" = "About Telegram Premium";
"lng_premium_summary_bottom_about" = "While the free version of Telegram already gives its users more than any other messaging application, **Telegram Premium** pushes its capabilities even further.\n\n**Telegram Premium** is a paid option, because most Premium Features require additional expenses from Telegram to third parties such as data center providers and server manufacturers. Contributions from **Telegram Premium** users allow us to cover such costs and also help Telegram stay free for everyone."; "lng_premium_summary_bottom_about" = "While the free version of Telegram already gives its users more than any other messaging application, **Telegram Premium** pushes its capabilities even further.\n\n**Telegram Premium** is a paid option, because most Premium Features require additional expenses from Telegram to third parties such as data center providers and server manufacturers. Contributions from **Telegram Premium** users allow us to cover such costs and also help Telegram stay free for everyone.";
"lng_premium_summary_button" = "Subscribe for {cost} per month"; "lng_premium_summary_button" = "Subscribe for {cost} per month";
@@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/unixtime.h" #include "base/unixtime.h"
#include "boxes/peers/replace_boost_box.h" #include "boxes/peers/replace_boost_box.h"
#include "boxes/background_box.h" #include "boxes/background_box.h"
#include "boxes/premium_preview_box.h"
#include "boxes/star_gift_box.h" #include "boxes/star_gift_box.h"
#include "boxes/stickers_box.h" #include "boxes/stickers_box.h"
#include "boxes/transfer_gift_box.h" #include "boxes/transfer_gift_box.h"
@@ -525,23 +526,17 @@ void Set(
} }
} }
bool ShowPremiumToast( bool ShowPremiumPreview(
std::shared_ptr<ChatHelpers::Show> show, std::shared_ptr<ChatHelpers::Show> show,
not_null<PeerData*> peer) { not_null<PeerData*> peer) {
if (!peer->isSelf() || show->session().premium()) { if (!peer->isSelf() || show->session().premium()) {
return false; return false;
} }
Settings::ShowPremiumPromoToast( if (const auto controller = show->resolveWindow()) {
show, ShowPremiumPreviewBox(controller, PremiumFeature::PeerColors);
tr::lng_settings_color_subscribe( return true;
tr::now, }
lt_link, return false;
Ui::Text::Link(
Ui::Text::Bold(
tr::lng_send_as_premium_required_link(tr::now))),
Ui::Text::WithEntities),
u"name_color"_q);
return true;
} }
void Apply( void Apply(
@@ -1941,7 +1936,7 @@ void EditPeerColorSection(
button->setClickedCallback([=] { button->setClickedCallback([=] {
if (state->applying) { if (state->applying) {
return; return;
} else if (ShowPremiumToast(show, peer)) { } else if (ShowPremiumPreview(show, peer)) {
return; return;
} }
const auto values = SetValues{ const auto values = SetValues{
@@ -2204,7 +2199,7 @@ void EditPeerProfileColorSection(
button->setClickedCallback([=] { button->setClickedCallback([=] {
if (profileState->applying) { if (profileState->applying) {
return; return;
} else if (ShowPremiumToast(show, peer)) { } else if (ShowPremiumPreview(show, peer)) {
return; return;
} }
const auto values = SetValues{ const auto values = SetValues{
@@ -135,6 +135,8 @@ void PreloadSticker(const std::shared_ptr<Data::DocumentMedia> &media) {
return tr::lng_premium_summary_subtitle_effects(); return tr::lng_premium_summary_subtitle_effects();
case PremiumFeature::TodoLists: case PremiumFeature::TodoLists:
return tr::lng_premium_summary_subtitle_todo_lists(); return tr::lng_premium_summary_subtitle_todo_lists();
case PremiumFeature::PeerColors:
return tr::lng_premium_summary_subtitle_peer_colors();
case PremiumFeature::BusinessLocation: case PremiumFeature::BusinessLocation:
return tr::lng_business_subtitle_location(); return tr::lng_business_subtitle_location();
@@ -202,6 +204,8 @@ void PreloadSticker(const std::shared_ptr<Data::DocumentMedia> &media) {
return tr::lng_premium_summary_about_effects(); return tr::lng_premium_summary_about_effects();
case PremiumFeature::TodoLists: case PremiumFeature::TodoLists:
return tr::lng_premium_summary_about_todo_lists(); return tr::lng_premium_summary_about_todo_lists();
case PremiumFeature::PeerColors:
return tr::lng_premium_summary_about_peer_colors();
case PremiumFeature::BusinessLocation: case PremiumFeature::BusinessLocation:
return tr::lng_business_about_location(); return tr::lng_business_about_location();
@@ -543,6 +547,7 @@ struct VideoPreviewDocument {
case PremiumFeature::MessagePrivacy: return "message_privacy"; case PremiumFeature::MessagePrivacy: return "message_privacy";
case PremiumFeature::Effects: return "effects"; case PremiumFeature::Effects: return "effects";
case PremiumFeature::TodoLists: return "todo"; case PremiumFeature::TodoLists: return "todo";
case PremiumFeature::PeerColors: return "peer_colors";
case PremiumFeature::BusinessLocation: return "business_location"; case PremiumFeature::BusinessLocation: return "business_location";
case PremiumFeature::BusinessHours: return "business_hours"; case PremiumFeature::BusinessHours: return "business_hours";
@@ -73,6 +73,7 @@ enum class PremiumFeature {
Effects, Effects,
FilterTags, FilterTags,
TodoLists, TodoLists,
PeerColors,
// Business features. // Business features.
BusinessLocation, BusinessLocation,