mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 14:17:45 +00:00
Option to disable taskbar flashing
This commit is contained in:
@@ -15,5 +15,6 @@
|
|||||||
// "net_speed_boost": null,
|
// "net_speed_boost": null,
|
||||||
// "show_phone_in_drawer": true,
|
// "show_phone_in_drawer": true,
|
||||||
// "scales": [],
|
// "scales": [],
|
||||||
// "confirm_before_calls": false
|
// "confirm_before_calls": false,
|
||||||
|
// "no_taskbar_flash": false
|
||||||
}
|
}
|
||||||
|
@@ -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_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_other" = "Other";
|
||||||
"ktg_settings_show_chat_id" = "Show chat ID";
|
"ktg_settings_show_chat_id" = "Show chat ID";
|
||||||
"ktg_profile_copy_id" = "Copy ID";
|
"ktg_profile_copy_id" = "Copy ID";
|
||||||
|
@@ -74,6 +74,8 @@
|
|||||||
"ktg_net_speed_boost_medium": "Среднее",
|
"ktg_net_speed_boost_medium": "Среднее",
|
||||||
"ktg_net_speed_boost_big": "Высокое",
|
"ktg_net_speed_boost_big": "Высокое",
|
||||||
"ktg_net_boost_restart_desc": "Для изменения ускорения загрузки на сервер требуется перезапуск.\n\nПерезапустить сейчас?",
|
"ktg_net_boost_restart_desc": "Для изменения ускорения загрузки на сервер требуется перезапуск.\n\nПерезапустить сейчас?",
|
||||||
|
"ktg_settings_system": "Система",
|
||||||
|
"ktg_settings_no_taskbar_flash": "Отключить мигание на панели задач",
|
||||||
"ktg_settings_other": "Прочие",
|
"ktg_settings_other": "Прочие",
|
||||||
"ktg_settings_show_chat_id": "Показывать ID чата",
|
"ktg_settings_show_chat_id": "Показывать ID чата",
|
||||||
"ktg_profile_copy_id": "Копировать ID",
|
"ktg_profile_copy_id": "Копировать ID",
|
||||||
|
@@ -270,6 +270,11 @@ bool Manager::readCustomFile() {
|
|||||||
if (settingsCallConfirmIt != settings.constEnd() && (*settingsCallConfirmIt).isBool()) {
|
if (settingsCallConfirmIt != settings.constEnd() && (*settingsCallConfirmIt).isBool()) {
|
||||||
cSetConfirmBeforeCall((*settingsCallConfirmIt).toBool());
|
cSetConfirmBeforeCall((*settingsCallConfirmIt).toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto settingsNoTaskbarFlashing = settings.constFind(qsl("no_taskbar_flash"));
|
||||||
|
if (settingsNoTaskbarFlashing != settings.constEnd() && (*settingsNoTaskbarFlashing).isBool()) {
|
||||||
|
cSetNoTaskbarFlashing((*settingsNoTaskbarFlashing).toBool());
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,6 +314,7 @@ void Manager::writeDefaultFile() {
|
|||||||
settings.insert(qsl("chat_list_lines"), DialogListLines());
|
settings.insert(qsl("chat_list_lines"), DialogListLines());
|
||||||
settings.insert(qsl("disable_up_edit"), cDisableUpEdit());
|
settings.insert(qsl("disable_up_edit"), cDisableUpEdit());
|
||||||
settings.insert(qsl("confirm_before_calls"), cConfirmBeforeCall());
|
settings.insert(qsl("confirm_before_calls"), cConfirmBeforeCall());
|
||||||
|
settings.insert(qsl("no_taskbar_flash"), cNoTaskbarFlashing());
|
||||||
|
|
||||||
auto settingsScales = QJsonArray();
|
auto settingsScales = QJsonArray();
|
||||||
settings.insert(qsl("scales"), settingsScales);
|
settings.insert(qsl("scales"), settingsScales);
|
||||||
@@ -369,6 +375,7 @@ void Manager::writeCurrentSettings() {
|
|||||||
settings.insert(qsl("chat_list_lines"), DialogListLines());
|
settings.insert(qsl("chat_list_lines"), DialogListLines());
|
||||||
settings.insert(qsl("disable_up_edit"), cDisableUpEdit());
|
settings.insert(qsl("disable_up_edit"), cDisableUpEdit());
|
||||||
settings.insert(qsl("confirm_before_calls"), cConfirmBeforeCall());
|
settings.insert(qsl("confirm_before_calls"), cConfirmBeforeCall());
|
||||||
|
settings.insert(qsl("no_taskbar_flash"), cNoTaskbarFlashing());
|
||||||
|
|
||||||
auto settingsScales = QJsonArray();
|
auto settingsScales = QJsonArray();
|
||||||
auto currentScales = cInterfaceScales();
|
auto currentScales = cInterfaceScales();
|
||||||
|
@@ -220,6 +220,7 @@ bool gUseSystemFont = false;
|
|||||||
|
|
||||||
bool gUseOriginalMetrics = false;
|
bool gUseOriginalMetrics = false;
|
||||||
|
|
||||||
|
|
||||||
rpl::variable<int> gStickerHeight = 170;
|
rpl::variable<int> gStickerHeight = 170;
|
||||||
void SetStickerHeight(int height) {
|
void SetStickerHeight(int height) {
|
||||||
gStickerHeight = height;
|
gStickerHeight = height;
|
||||||
@@ -301,3 +302,4 @@ bool AddCustomReplace(QString from, QString to) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool gConfirmBeforeCall = false;
|
bool gConfirmBeforeCall = false;
|
||||||
|
bool gNoTaskbarFlashing = false;
|
||||||
|
@@ -188,6 +188,7 @@ DeclareSetting(QString, MonospaceFont);
|
|||||||
DeclareSetting(bool, UseSystemFont);
|
DeclareSetting(bool, UseSystemFont);
|
||||||
DeclareSetting(bool, UseOriginalMetrics);
|
DeclareSetting(bool, UseOriginalMetrics);
|
||||||
|
|
||||||
|
|
||||||
void SetBigEmojiOutline(bool enabled);
|
void SetBigEmojiOutline(bool enabled);
|
||||||
[[nodiscard]] bool BigEmojiOutline();
|
[[nodiscard]] bool BigEmojiOutline();
|
||||||
[[nodiscard]] rpl::producer<bool> BigEmojiOutlineChanges();
|
[[nodiscard]] rpl::producer<bool> BigEmojiOutlineChanges();
|
||||||
@@ -240,3 +241,4 @@ using CustomReplacementsMap = QMap<QString, QString>;
|
|||||||
DeclareRefSetting(CustomReplacementsMap, CustomReplaces);
|
DeclareRefSetting(CustomReplacementsMap, CustomReplaces);
|
||||||
bool AddCustomReplace(QString from, QString to);
|
bool AddCustomReplace(QString from, QString to);
|
||||||
DeclareSetting(bool, ConfirmBeforeCall);
|
DeclareSetting(bool, ConfirmBeforeCall);
|
||||||
|
DeclareSetting(bool, NoTaskbarFlashing);
|
||||||
|
@@ -169,6 +169,28 @@ void SetupKotatoNetwork(not_null<Ui::VerticalLayout*> container) {
|
|||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetupKotatoSystem(not_null<Ui::VerticalLayout*> 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<Ui::VerticalLayout*> container) {
|
void SetupKotatoOther(not_null<Ui::VerticalLayout*> container) {
|
||||||
AddDivider(container);
|
AddDivider(container);
|
||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
@@ -231,6 +253,7 @@ void Kotato::setupContent(not_null<Window::SessionController*> controller) {
|
|||||||
|
|
||||||
SetupKotatoChats(content);
|
SetupKotatoChats(content);
|
||||||
SetupKotatoNetwork(content);
|
SetupKotatoNetwork(content);
|
||||||
|
SetupKotatoSystem(content);
|
||||||
SetupKotatoOther(content);
|
SetupKotatoOther(content);
|
||||||
|
|
||||||
Ui::ResizeFitChild(this, content);
|
Ui::ResizeFitChild(this, content);
|
||||||
|
@@ -15,6 +15,7 @@ namespace Settings {
|
|||||||
|
|
||||||
void SetupKotatoChats(not_null<Ui::VerticalLayout*> container);
|
void SetupKotatoChats(not_null<Ui::VerticalLayout*> container);
|
||||||
void SetupKotatoNetwork(not_null<Ui::VerticalLayout*> container);
|
void SetupKotatoNetwork(not_null<Ui::VerticalLayout*> container);
|
||||||
|
void SetupKotatoSystem(not_null<Ui::VerticalLayout*> container);
|
||||||
void SetupKotatoOther(not_null<Ui::VerticalLayout*> container);
|
void SetupKotatoOther(not_null<Ui::VerticalLayout*> container);
|
||||||
|
|
||||||
class Kotato : public Section {
|
class Kotato : public Section {
|
||||||
|
@@ -290,7 +290,9 @@ void System::showNext() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (alert) {
|
if (alert) {
|
||||||
Platform::Notifications::FlashBounce();
|
if (!cNoTaskbarFlashing()) {
|
||||||
|
Platform::Notifications::FlashBounce();
|
||||||
|
}
|
||||||
if (Global::SoundNotify() && !Platform::Notifications::SkipAudio()) {
|
if (Global::SoundNotify() && !Platform::Notifications::SkipAudio()) {
|
||||||
ensureSoundCreated();
|
ensureSoundCreated();
|
||||||
_soundTrack->playOnce();
|
_soundTrack->playOnce();
|
||||||
|
Reference in New Issue
Block a user