diff --git a/Telegram/Resources/icons/info_notifications_active.png b/Telegram/Resources/icons/info_notifications_active.png new file mode 100644 index 000000000..93aa4e90f Binary files /dev/null and b/Telegram/Resources/icons/info_notifications_active.png differ diff --git a/Telegram/Resources/icons/info_notifications_active@2x.png b/Telegram/Resources/icons/info_notifications_active@2x.png new file mode 100644 index 000000000..4cb37d17d Binary files /dev/null and b/Telegram/Resources/icons/info_notifications_active@2x.png differ diff --git a/Telegram/Resources/icons/info_notifications_active@3x.png b/Telegram/Resources/icons/info_notifications_active@3x.png new file mode 100644 index 000000000..4844781da Binary files /dev/null and b/Telegram/Resources/icons/info_notifications_active@3x.png differ diff --git a/Telegram/Resources/langs/rewrites/en.json b/Telegram/Resources/langs/rewrites/en.json index 5f77e3d38..3879adcb4 100644 --- a/Telegram/Resources/langs/rewrites/en.json +++ b/Telegram/Resources/langs/rewrites/en.json @@ -91,6 +91,7 @@ "ktg_settings_filters_only_unmuted_counter": "Do not count muted chats", "ktg_settings_filters_hide_edit": "Hide Edit button", "ktg_settings_filters_hide_folder_names": "Compact folders", + "ktg_settings_top_bar_mute": "Mute in profile top bar", "ktg_settings_messages": "Messages", "ktg_settings_filters_hide_all": "Hide \"All chats\" folder", "ktg_settings_userpic_rounding": "Profile pictures rounding", diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index 4c63c733c..edd25a689 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -144,7 +144,7 @@ infoTopBarNotifications: IconButton(infoTopBarMenu) { rippleAreaPosition: point(0px, 6px); } infoNotificationsActive: icon {{ - "info_notifications", + "info_notifications_active", windowBgActive }}; infoTopBarCall: IconButton(infoTopBarNotifications) { diff --git a/Telegram/SourceFiles/info/info_wrap_widget.cpp b/Telegram/SourceFiles/info/info_wrap_widget.cpp index 30c871793..8d825b814 100644 --- a/Telegram/SourceFiles/info/info_wrap_widget.cpp +++ b/Telegram/SourceFiles/info/info_wrap_widget.cpp @@ -392,7 +392,6 @@ void WrapWidget::createTopBar() { && (wrapValue != Wrap::Side || hasStackHistory())) { addTopBarMenuButton(); addProfileCallsButton(); -// addProfileNotificationsButton(); } else if (section.type() == Section::Type::Settings && (section.settingsType() == Section::SettingsType::Main || section.settingsType() == Section::SettingsType::Chat @@ -403,6 +402,11 @@ void WrapWidget::createTopBar() { addContentSaveButton(); } + if (section.type() == Section::Type::Profile + && ::Kotato::JsonSettings::GetBool("profile_top_mute")) { + addProfileNotificationsButton(); + } + _topBar->lower(); _topBar->resizeToWidth(width()); _topBar->finishAnimating(); @@ -505,7 +509,7 @@ void WrapWidget::addProfileNotificationsButton() { Expects(_topBar != nullptr); const auto peer = key().peer(); - if (!peer) { + if (!peer || peer->isSelf()) { return; } auto notifications = _topBar->addButton( diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 27479a253..97353a382 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -407,7 +407,7 @@ object_ptr DetailsFiller::setupInfo() { addInfoLine(tr::lng_info_about_label(), AboutValue(_peer)); } - if (!_peer->isSelf()) { + if (!_peer->isSelf() && !::Kotato::JsonSettings::GetBool("profile_top_mute")) { // No notifications toggle for Self => no separator. result->add(object_ptr>( result, @@ -548,7 +548,7 @@ object_ptr DetailsFiller::fill() { add(object_ptr(_wrap)); add(CreateSkipWidget(_wrap)); add(setupInfo()); - if (!_peer->isSelf()) { + if (!_peer->isSelf() && !::Kotato::JsonSettings::GetBool("profile_top_mute")) { add(setupMuteToggle()); } setupMainButtons(); diff --git a/Telegram/SourceFiles/kotato/kotato_settings.cpp b/Telegram/SourceFiles/kotato/kotato_settings.cpp index 5a8092c3a..9521ac059 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings.cpp @@ -424,6 +424,9 @@ const std::map> DefinitionMap { { "folders/hide_all_chats", { .type = SettingType::BoolSetting, .defaultValue = false, }}, + { "profile_top_mute", { + .type = SettingType::BoolSetting, + .defaultValue = false, }}, { "folders/local", { .scope = SettingScope::Account, .type = SettingType::QJsonArraySetting, }}, diff --git a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp index 913e3d5c8..84eab386b 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp @@ -213,6 +213,7 @@ void SetupKotatoChats( updateRecentStickersLimitHeight); updateRecentStickersLimitLabel(::Kotato::JsonSettings::GetInt("recent_stickers_limit")); + SettingsMenuJsonSwitch(ktg_settings_top_bar_mute, profile_top_mute); SettingsMenuJsonSwitch(ktg_settings_disable_up_edit, disable_up_edit); AddButton(