From eab249fc138a07aa2d65210e7b156cbb1d7d583d Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 6 Mar 2024 19:40:01 +0300 Subject: [PATCH] Fixed countdown label for input field of bio. --- Telegram/SourceFiles/history/history_widget.cpp | 6 ++++++ Telegram/SourceFiles/settings/settings_information.cpp | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index f288a1883..b658b8555 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -3892,7 +3892,13 @@ void HistoryWidget::saveEditMsg() { if (remove > 0) { controller()->showToast( tr::lng_edit_limit_reached(tr::now, lt_count, remove)); +#ifndef _DEBUG return; +#else + if (!base::IsCtrlPressed()) { + return; + } +#endif } } diff --git a/Telegram/SourceFiles/settings/settings_information.cpp b/Telegram/SourceFiles/settings/settings_information.cpp index ef6068987..6a46992cc 100644 --- a/Telegram/SourceFiles/settings/settings_information.cpp +++ b/Telegram/SourceFiles/settings/settings_information.cpp @@ -483,7 +483,8 @@ void SetupBio( } changed->fire(*current != text); const auto limit = self->isPremium() ? premiumLimit : defaultLimit; - const auto countLeft = limit - int(text.size()); + const auto countLeft = limit + - bio->lastTextSizeWithoutSurrogatePairsCount(); countdown->setText(QString::number(countLeft)); countdown->setTextColorOverride( countLeft < 0 ? st::boxTextFgError->c : std::optional());