diff --git a/Telegram/Resources/icons/menu/premium.png b/Telegram/Resources/icons/menu/premium.png new file mode 100644 index 000000000..56e0e0e94 Binary files /dev/null and b/Telegram/Resources/icons/menu/premium.png differ diff --git a/Telegram/Resources/icons/menu/premium@2x.png b/Telegram/Resources/icons/menu/premium@2x.png new file mode 100644 index 000000000..64913421b Binary files /dev/null and b/Telegram/Resources/icons/menu/premium@2x.png differ diff --git a/Telegram/Resources/icons/menu/premium@3x.png b/Telegram/Resources/icons/menu/premium@3x.png new file mode 100644 index 000000000..0ba0e8b9f Binary files /dev/null and b/Telegram/Resources/icons/menu/premium@3x.png differ diff --git a/Telegram/SourceFiles/boxes/peers/edit_members_visible.cpp b/Telegram/SourceFiles/boxes/peers/edit_members_visible.cpp index b51451817..ed0a363a2 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_members_visible.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_members_visible.cpp @@ -53,8 +53,8 @@ namespace { tr::lng_profile_hide_participants(), rpl::single(QString()), [] {}, - st::manageGroupTopicsButton, - { &st::menuIconHideMembers } + st::manageGroupNoIconButton, + {} ))->toggleOn(rpl::single( (megagroup->flags() & ChannelDataFlag::ParticipantsHidden) != 0 ) | rpl::then(state->toggled.events())); diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index b1d81d809..d54deb94b 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -600,15 +600,20 @@ manageGroupTopicsButton: SettingsCountButton(manageGroupTopButtonWithText) { } } } +manageGroupNoIconButtonInner: SettingsButton(infoProfileButton) { + padding: margins(25px, 11px, 24px, 8px); +} +manageGroupNoIconButton: SettingsCountButton(manageGroupTopButtonWithText) { + button: manageGroupNoIconButtonInner; + labelPosition: point(22px, 11px); + iconPosition: point(0px, 0px); +} -manageDeleteGroupButton: SettingsCountButton(manageGroupTopButtonWithText) { - button: SettingsButton(infoProfileButton) { - padding: margins(25px, 11px, 24px, 8px); +manageDeleteGroupButton: SettingsCountButton(manageGroupNoIconButton) { + button: SettingsButton(manageGroupNoIconButtonInner) { textFg: attentionButtonFg; textFgOver: attentionButtonFg; } - labelPosition: point(22px, 11px); - iconPosition: point(0px, 0px); } infoEmptyFg: windowSubTextFg; diff --git a/Telegram/SourceFiles/settings/settings_main.cpp b/Telegram/SourceFiles/settings/settings_main.cpp index 9e6c8a2af..f00224827 100644 --- a/Telegram/SourceFiles/settings/settings_main.cpp +++ b/Telegram/SourceFiles/settings/settings_main.cpp @@ -312,9 +312,6 @@ void SetupSections( st::settingsButton, std::move(descriptor) )->addClickHandler([=] { - if (type == PremiumId()) { - controller->setPremiumRef("settings"); - } showOther(type); }); }; @@ -398,27 +395,28 @@ void SetupSections( SetupPowerSavingButton(&controller->window(), container); SetupLanguageButton(&controller->window(), container); - if (controller->session().premiumPossible()) { - AddSkip(container); - AddDivider(container); - AddSkip(container); + AddSkip(container); +} - const auto icon = &st::settingsPremiumIconStar; - auto gradient = QLinearGradient( - 0, - icon->height(), - icon->width() + icon->width() / 3, - 0 - icon->height() / 3); - gradient.setStops(QGradientStops{ - { 0.0, st::premiumButtonBg1->c }, - { 1.0, st::premiumButtonBg3->c }, - }); - addSection( - tr::lng_premium_summary_title(), - PremiumId(), - { .icon = icon, .backgroundBrush = QBrush(gradient) }); +void SetupPremium( + not_null controller, + not_null container, + Fn showOther) { + if (!controller->session().premiumPossible()) { + return; } + AddDivider(container); + AddSkip(container); + AddButton( + container, + tr::lng_premium_summary_title(), + st::settingsButton, + { .icon = &st::menuIconPremium } + )->addClickHandler([=] { + controller->setPremiumRef("settings"); + showOther(PremiumId()); + }); AddSkip(container); } @@ -686,6 +684,9 @@ void Main::setupContent(not_null controller) { SetupInterfaceScale(&controller->window(), content); AddSkip(content); } + SetupPremium(controller, content, [=](Type type) { + _showOther.fire_copy(type); + }); SetupHelp(controller, content); Ui::ResizeFitChild(this, content); diff --git a/Telegram/SourceFiles/ui/menu_icons.style b/Telegram/SourceFiles/ui/menu_icons.style index 13aed59aa..7aaf32213 100644 --- a/Telegram/SourceFiles/ui/menu_icons.style +++ b/Telegram/SourceFiles/ui/menu_icons.style @@ -134,7 +134,7 @@ menuIconSigned: icon {{ "menu/signed", menuIconColor }}; menuIconAntispam: icon {{ "menu/antispam", menuIconColor }}; menuIconChatDiscuss: icon {{ "menu/chat_discuss", menuIconColor }}; menuIconBotCommands: icon {{ "menu/bot_commands", menuIconColor }}; -menuIconHideMembers: icon {{ "menu/hide_members", menuIconColor }}; +menuIconPremium: icon {{ "menu/premium", menuIconColor }}; menuIconTTLAny: icon {{ "menu/auto_delete_plain", menuIconColor }}; menuIconTTLAnyTextPosition: point(11px, 22px);