diff --git a/Telegram/Resources/default_kotato-settings-custom.json b/Telegram/Resources/default_kotato-settings-custom.json index 5bb962664..304eb92a3 100644 --- a/Telegram/Resources/default_kotato-settings-custom.json +++ b/Telegram/Resources/default_kotato-settings-custom.json @@ -15,5 +15,6 @@ // "net_speed_boost": null, // "show_phone_in_drawer": true, // "scales": [], - // "confirm_before_calls": false + // "confirm_before_calls": false, + // "no_taskbar_flash": false } diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 8b58fe5c7..f20737722 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2355,6 +2355,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ktg_net_boost_restart_desc" = "You'll need to restart app to change upload boost.\n\nRestart now?"; +"ktg_settings_system" = "System"; +"ktg_settings_no_taskbar_flash" = "Disable taskbar flashing"; + "ktg_settings_other" = "Other"; "ktg_settings_show_chat_id" = "Show chat ID"; "ktg_profile_copy_id" = "Copy ID"; diff --git a/Telegram/Resources/langs/rewrites/ru.json b/Telegram/Resources/langs/rewrites/ru.json index 43e36b2c0..dad3d5342 100644 --- a/Telegram/Resources/langs/rewrites/ru.json +++ b/Telegram/Resources/langs/rewrites/ru.json @@ -74,6 +74,8 @@ "ktg_net_speed_boost_medium": "Среднее", "ktg_net_speed_boost_big": "Высокое", "ktg_net_boost_restart_desc": "Для изменения ускорения загрузки на сервер требуется перезапуск.\n\nПерезапустить сейчас?", + "ktg_settings_system": "Система", + "ktg_settings_no_taskbar_flash": "Отключить мигание на панели задач", "ktg_settings_other": "Прочие", "ktg_settings_show_chat_id": "Показывать ID чата", "ktg_profile_copy_id": "Копировать ID", diff --git a/Telegram/SourceFiles/core/kotato_settings.cpp b/Telegram/SourceFiles/core/kotato_settings.cpp index 2ca2aa62a..ff289f15b 100644 --- a/Telegram/SourceFiles/core/kotato_settings.cpp +++ b/Telegram/SourceFiles/core/kotato_settings.cpp @@ -270,6 +270,11 @@ bool Manager::readCustomFile() { if (settingsCallConfirmIt != settings.constEnd() && (*settingsCallConfirmIt).isBool()) { cSetConfirmBeforeCall((*settingsCallConfirmIt).toBool()); } + + const auto settingsNoTaskbarFlashing = settings.constFind(qsl("no_taskbar_flash")); + if (settingsNoTaskbarFlashing != settings.constEnd() && (*settingsNoTaskbarFlashing).isBool()) { + cSetNoTaskbarFlashing((*settingsNoTaskbarFlashing).toBool()); + } return true; } @@ -309,6 +314,7 @@ void Manager::writeDefaultFile() { settings.insert(qsl("chat_list_lines"), DialogListLines()); settings.insert(qsl("disable_up_edit"), cDisableUpEdit()); settings.insert(qsl("confirm_before_calls"), cConfirmBeforeCall()); + settings.insert(qsl("no_taskbar_flash"), cNoTaskbarFlashing()); auto settingsScales = QJsonArray(); settings.insert(qsl("scales"), settingsScales); @@ -369,6 +375,7 @@ void Manager::writeCurrentSettings() { settings.insert(qsl("chat_list_lines"), DialogListLines()); settings.insert(qsl("disable_up_edit"), cDisableUpEdit()); settings.insert(qsl("confirm_before_calls"), cConfirmBeforeCall()); + settings.insert(qsl("no_taskbar_flash"), cNoTaskbarFlashing()); auto settingsScales = QJsonArray(); auto currentScales = cInterfaceScales(); diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index c044352f5..17f2762ae 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -220,6 +220,7 @@ bool gUseSystemFont = false; bool gUseOriginalMetrics = false; + rpl::variable gStickerHeight = 170; void SetStickerHeight(int height) { gStickerHeight = height; @@ -301,3 +302,4 @@ bool AddCustomReplace(QString from, QString to) { } bool gConfirmBeforeCall = false; +bool gNoTaskbarFlashing = false; diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index 31a9b52ff..b3a3d6e3c 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -188,6 +188,7 @@ DeclareSetting(QString, MonospaceFont); DeclareSetting(bool, UseSystemFont); DeclareSetting(bool, UseOriginalMetrics); + void SetBigEmojiOutline(bool enabled); [[nodiscard]] bool BigEmojiOutline(); [[nodiscard]] rpl::producer BigEmojiOutlineChanges(); @@ -240,3 +241,4 @@ using CustomReplacementsMap = QMap; DeclareRefSetting(CustomReplacementsMap, CustomReplaces); bool AddCustomReplace(QString from, QString to); DeclareSetting(bool, ConfirmBeforeCall); +DeclareSetting(bool, NoTaskbarFlashing); diff --git a/Telegram/SourceFiles/settings/settings_kotato.cpp b/Telegram/SourceFiles/settings/settings_kotato.cpp index 549eebe6a..0fbb22df5 100644 --- a/Telegram/SourceFiles/settings/settings_kotato.cpp +++ b/Telegram/SourceFiles/settings/settings_kotato.cpp @@ -169,6 +169,28 @@ void SetupKotatoNetwork(not_null container) { AddSkip(container); } +void SetupKotatoSystem(not_null container) { + AddDivider(container); + AddSkip(container); + AddSubsectionTitle(container, tr::ktg_settings_system()); + + AddButton( + container, + tr::ktg_settings_no_taskbar_flash(), + st::settingsButton + )->toggleOn( + rpl::single(cNoTaskbarFlashing()) + )->toggledValue( + ) | rpl::filter([](bool enabled) { + return (enabled != cNoTaskbarFlashing()); + }) | rpl::start_with_next([](bool enabled) { + cSetNoTaskbarFlashing(enabled); + KotatoSettings::Write(); + }, container->lifetime()); + + AddSkip(container); +} + void SetupKotatoOther(not_null container) { AddDivider(container); AddSkip(container); @@ -231,6 +253,7 @@ void Kotato::setupContent(not_null controller) { SetupKotatoChats(content); SetupKotatoNetwork(content); + SetupKotatoSystem(content); SetupKotatoOther(content); Ui::ResizeFitChild(this, content); diff --git a/Telegram/SourceFiles/settings/settings_kotato.h b/Telegram/SourceFiles/settings/settings_kotato.h index 30136c597..c6d5e44ef 100644 --- a/Telegram/SourceFiles/settings/settings_kotato.h +++ b/Telegram/SourceFiles/settings/settings_kotato.h @@ -15,6 +15,7 @@ namespace Settings { void SetupKotatoChats(not_null container); void SetupKotatoNetwork(not_null container); +void SetupKotatoSystem(not_null container); void SetupKotatoOther(not_null container); class Kotato : public Section { diff --git a/Telegram/SourceFiles/window/notifications_manager.cpp b/Telegram/SourceFiles/window/notifications_manager.cpp index f5f5dc366..43ad00574 100644 --- a/Telegram/SourceFiles/window/notifications_manager.cpp +++ b/Telegram/SourceFiles/window/notifications_manager.cpp @@ -290,7 +290,9 @@ void System::showNext() { } } if (alert) { - Platform::Notifications::FlashBounce(); + if (!cNoTaskbarFlashing()) { + Platform::Notifications::FlashBounce(); + } if (Global::SoundNotify() && !Platform::Notifications::SkipAudio()) { ensureSoundCreated(); _soundTrack->playOnce();