diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 8b23e079a..3722bd5e9 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -4733,6 +4733,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ayu_ShowKllButtonInDrawer" = "Show kill app button"; "ayu_SettingsShowID" = "Show peer ID"; "ayu_SettingsShowID_Hide" = "Hide"; +"ayu_SettingsShowMessageShot" = "Show message shot"; "ayu_SettingsRecentStickersCount" = "Recent stickers count"; "ayu_SettingsCustomizationHint" = "After making changes to the \"Customization\" section, you must restart the application."; "ayu_SettingsContextMenuTitle" = "Select item show type"; diff --git a/Telegram/SourceFiles/ayu/ayu_settings.cpp b/Telegram/SourceFiles/ayu/ayu_settings.cpp index 2141b20fb..281cb23b3 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.cpp +++ b/Telegram/SourceFiles/ayu/ayu_settings.cpp @@ -257,6 +257,7 @@ AyuGramSettings::AyuGramSettings() */ showPeerId = 2; showMessageSeconds = false; + showMessageShot = true; // ~ Confirmations stickerConfirmation = false; @@ -492,6 +493,11 @@ void AyuGramSettings::set_showMessageSeconds(bool val) showMessageSeconds = val; } +void AyuGramSettings::set_showMessageShot(bool val) +{ + showMessageShot = val; +} + void AyuGramSettings::set_stickerConfirmation(bool val) { stickerConfirmation = val; diff --git a/Telegram/SourceFiles/ayu/ayu_settings.h b/Telegram/SourceFiles/ayu/ayu_settings.h index b672b784e..83a6bfcc1 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.h +++ b/Telegram/SourceFiles/ayu/ayu_settings.h @@ -71,6 +71,7 @@ public: int showPeerId; bool showMessageSeconds; + bool showMessageShot; bool stickerConfirmation; bool gifConfirmation; @@ -132,6 +133,7 @@ public: void set_showPeerId(int val); void set_showMessageSeconds(bool val); + void set_showMessageShot(bool val); void set_stickerConfirmation(bool val); void set_gifConfirmation(bool val); @@ -181,6 +183,7 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT( hideAllChatsFolder, showPeerId, showMessageSeconds, + showMessageShot, stickerConfirmation, gifConfirmation, voiceConfirmation diff --git a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp index bb6b1b2d0..49d3a3f0b 100644 --- a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp +++ b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp @@ -1236,6 +1236,24 @@ void SetupNerdSettings(not_null container, not_nulllifetime()); + AddButtonWithIcon( + container, + tr::ayu_SettingsShowMessageShot(), + st::settingsButtonNoIcon + )->toggleOn( + rpl::single(settings->showMessageShot) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (enabled != settings->showMessageShot); + }) | start_with_next( + [=](bool enabled) + { + settings->set_showMessageShot(enabled); + AyuSettings::save(); + }, + container->lifetime()); } void SetupCustomization(not_null container, diff --git a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp index f29c34ea0..1408ce523 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -1100,9 +1100,12 @@ void TopBarWidget::updateControlsVisibility() { hideChildren(); return; } + + const auto settings = &AyuSettings::getInstance(); + _clear->show(); _delete->setVisible(_canDelete); - _messageShot->setVisible(true); + _messageShot->setVisible(settings->showMessageShot); _forward->setVisible(_canForward); _sendNow->setVisible(_canSendNow);