From a1a078f9982ec6a42ad5b5de078cf8cbdf4f7ce5 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 3 Apr 2026 16:24:38 +0300 Subject: [PATCH 01/50] Improved style of connection box with table-style. --- Telegram/Resources/langs/lang.strings | 5 + Telegram/SourceFiles/boxes/boxes.style | 36 ++++++++ Telegram/SourceFiles/boxes/connection_box.cpp | 92 +++++++++++++------ 3 files changed, 103 insertions(+), 30 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index a666ccb80a..1f9f61d5f4 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -324,6 +324,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_sure_enable_socks" = "Are you sure you want to enable this proxy?\n\nServer: {server}\nPort: {port}\n\nYou can change your proxy server later in Settings > Advanced > Connection Type."; "lng_sure_enable" = "Enable"; "lng_proxy_box_title" = "Enable proxy"; +"lng_proxy_box_table_title" = "Proxy Server"; +"lng_proxy_box_table_button" = "Connect Proxy"; +"lng_proxy_box_table_checking" = "Checking…"; +"lng_proxy_box_table_available" = "Available (ping: {ping} ms)"; +"lng_proxy_box_table_unavailable" = "Not Available"; "lng_proxy_box_server" = "Server"; "lng_proxy_box_port" = "Port"; "lng_proxy_box_secret" = "Secret"; diff --git a/Telegram/SourceFiles/boxes/boxes.style b/Telegram/SourceFiles/boxes/boxes.style index 23e34ce706..4fd2e656c8 100644 --- a/Telegram/SourceFiles/boxes/boxes.style +++ b/Telegram/SourceFiles/boxes/boxes.style @@ -669,6 +669,42 @@ proxyAboutSponsorPadding: margins(22px, 7px, 22px, 0px); proxyApplyBoxLabel : FlatLabel(defaultFlatLabel) { maxHeight: 30px; } +proxyApplyBoxTable: Table(defaultTable) { + labelMinWidth: 91px; +} +proxyApplyBoxTableMargin: margins(24px, 4px, 24px, 4px); +proxyApplyBoxTableLabelMargin: margins(13px, 10px, 13px, 10px); +proxyApplyBoxTableValueMargin: margins(13px, 9px, 13px, 9px); +proxyApplyBoxValueMultiline: FlatLabel(defaultTableValue) { + minWidth: 128px; + maxHeight: 100px; + style: TextStyle(defaultTextStyle) { + font: font(10px); + linkUnderline: kLinkUnderlineNever; + } +} +proxyApplyBoxSponsorLabel: FlatLabel(defaultFlatLabel) { + textFg: windowBoldFg; + minWidth: 100px; + align: align(top); + style: TextStyle(defaultTextStyle) { + font: font(11px); + } +} +proxyApplyBoxSponsorMargin: margins(13px, 8px, 13px, 8px); +proxyApplyBoxButton: RoundButton(defaultActiveButton) { + height: 38px; + textTop: 10px; + radius: 19px; + style: semiboldTextStyle; +} +proxyApplyBox: Box(defaultBox) { + buttonPadding: margins(22px, 11px, 22px, 22px); + buttonHeight: 38px; + buttonWide: true; + button: proxyApplyBoxButton; + shadowIgnoreTopSkip: true; +} markdownLinkFieldPadding: margins(22px, 0px, 22px, 10px); diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index b687c074e7..757586b04c 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -38,7 +38,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/menu/menu_add_action_callback.h" #include "ui/widgets/menu/menu_add_action_callback_factory.h" #include "ui/widgets/popup_menu.h" +#include "ui/controls/table_rows.h" #include "ui/wrap/slide_wrap.h" +#include "ui/wrap/table_layout.h" #include "ui/wrap/vertical_layout.h" #include "ui/vertical_list.h" #include "ui/ui_utility.h" @@ -47,6 +49,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "styles/style_layers.h" #include "styles/style_boxes.h" #include "styles/style_chat_helpers.h" +#include "styles/style_giveaway.h" #include "styles/style_info.h" #include "styles/style_menu_icons.h" #include "styles/style_settings.h" @@ -1417,44 +1420,73 @@ void ProxiesBoxController::ShowApplyConfirmation( ).replace(UrlEndRegExp, QString()); const auto box = [=](not_null box) { box->setTitle(tr::lng_proxy_box_title()); - if (type == Type::Mtproto) { - box->addRow(object_ptr( + box->setStyle(st::proxyApplyBox); + box->addTopButton(st::boxTitleClose, [=] { + box->closeBox(); + }); + + const auto table = box->addRow( + object_ptr( box, - tr::lng_proxy_sponsor_warning(), - st::boxDividerLabel)); - Ui::AddSkip(box->verticalLayout()); - Ui::AddSkip(box->verticalLayout()); - } - const auto &stL = st::proxyApplyBoxLabel; - const auto &stSubL = st::boxDividerLabel; - const auto add = [&](const QString &s, tr::phrase<> phrase) { - if (!s.isEmpty()) { - box->addRow(object_ptr(box, s, stL)); - box->addRow(object_ptr(box, phrase(), stSubL)); - Ui::AddSkip(box->verticalLayout()); - Ui::AddSkip(box->verticalLayout()); + st::giveawayGiftCodeTable), + st::giveawayGiftCodeTableMargin); + const auto add = [&]( + const QString &value, + rpl::producer label) { + if (!value.isEmpty()) { + constexpr auto kOneLineCount = 20; + const auto oneLine = value.length() <= kOneLineCount; + auto widget = object_ptr( + table, + rpl::single(Ui::Text::Wrapped( + { value }, + EntityType::Code, + {})), + (oneLine + ? table->st().defaultValue + : st::giveawayGiftCodeValueMultiline), + st::defaultPopupMenu); + Ui::AddTableRow( + table, + std::move(label), + std::move(widget)); } }; if (!displayServer.isEmpty()) { - add(displayServer, tr::lng_proxy_box_server); + add(displayServer, tr::lng_proxy_box_server()); } - add(QString::number(proxy.port), tr::lng_proxy_box_port); + add(QString::number(proxy.port), tr::lng_proxy_box_port()); if (type == Type::Socks5) { - add(proxy.user, tr::lng_proxy_box_username); - add(proxy.password, tr::lng_proxy_box_password); + add(proxy.user, tr::lng_proxy_box_username()); + add(proxy.password, tr::lng_proxy_box_password()); } else if (type == Type::Mtproto) { - add(proxy.password, tr::lng_proxy_box_secret); + add(proxy.password, tr::lng_proxy_box_secret()); } - const auto enableButton = box->addButton(tr::lng_sure_enable(), [=] { - auto &proxies = Core::App().settings().proxy().list(); - if (!ranges::contains(proxies, proxy)) { - proxies.push_back(proxy); - } - Core::App().setCurrentProxy(proxy, ProxyData::Settings::Enabled); - Local::writeSettings(); - box->closeBox(); - }); - box->addButton(tr::lng_cancel(), [=] { box->closeBox(); }); + + if (type == Type::Mtproto) { + table->addRow( + object_ptr( + table, + tr::lng_proxy_sponsor_warning(), + st::proxyApplyBoxSponsorLabel), + object_ptr(nullptr), + st::proxyApplyBoxSponsorMargin, + st::proxyApplyBoxSponsorMargin); + } + + const auto enableButton = box->addButton( + tr::lng_sure_enable(), + [=] { + auto &proxies = Core::App().settings().proxy().list(); + if (!ranges::contains(proxies, proxy)) { + proxies.push_back(proxy); + } + Core::App().setCurrentProxy( + proxy, + ProxyData::Settings::Enabled); + Local::writeSettings(); + box->closeBox(); + }); box->events( ) | rpl::on_next([=](not_null e) { if ((e->type() != QEvent::KeyPress) || !enableButton) { From 3386e427a081ec640f6888e6f466b2dee80f2a58 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 3 Apr 2026 16:25:49 +0300 Subject: [PATCH 02/50] Added ability to check status from connection box. --- Telegram/Resources/langs/lang.strings | 1 + Telegram/SourceFiles/boxes/connection_box.cpp | 211 ++++++++++++++---- Telegram/SourceFiles/boxes/connection_box.h | 1 - 3 files changed, 174 insertions(+), 39 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 1f9f61d5f4..2eca1fc8e9 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -333,6 +333,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_proxy_box_port" = "Port"; "lng_proxy_box_secret" = "Secret"; "lng_proxy_box_status" = "Status"; +"lng_proxy_box_check_status" = "Check Status"; "lng_proxy_box_username" = "Username"; "lng_proxy_box_password" = "Password"; "lng_proxy_invalid" = "The proxy link is invalid."; diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index 757586b04c..07e5185dba 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -1355,6 +1355,100 @@ void ProxyBox::addLabel( st::proxyEditTitlePadding); } +struct ProxyChecker { + using Checker = MTP::details::ConnectionPointer; + + Checker v4; + Checker v6; + + void start( + not_null mtproto, + const ProxyData &proxy, + Fn done, + Fn fail) { + using Connection = MTP::details::AbstractConnection; + using Variants = MTP::DcOptions::Variants; + + v4 = nullptr; + v6 = nullptr; + const auto connType = (proxy.type == ProxyData::Type::Http) + ? Variants::Http + : Variants::Tcp; + const auto dcId = mtproto->mainDcId(); + const auto setup = [&]( + Checker &checker, + const bytes::vector &secret) { + checker = Connection::Create( + mtproto, + connType, + QThread::currentThread(), + secret, + proxy); + const auto raw = checker.get(); + raw->connect(raw, &Connection::connected, [=] { + const auto ping = raw->pingTime(); + v4 = nullptr; + v6 = nullptr; + if (done) { + done(ping); + } + }); + const auto failed = [=] { + if (v4.get() == raw) { + v4 = nullptr; + } else if (v6.get() == raw) { + v6 = nullptr; + } + if (!v4 && !v6 && fail) { + fail(); + } + }; + raw->connect(raw, &Connection::disconnected, failed); + raw->connect(raw, &Connection::error, failed); + }; + if (proxy.type == ProxyData::Type::Mtproto) { + const auto secret = proxy.secretFromMtprotoPassword(); + setup(v4, secret); + v4->connectToServer( + proxy.host, + proxy.port, + secret, + dcId, + false); + } else { + const auto options = mtproto->dcOptions().lookup( + dcId, + MTP::DcType::Regular, + true); + const auto tryConnect = [&]( + Checker &checker, + Variants::Address address) { + const auto &list = options.data[address][connType]; + if (list.empty() + || ((address == Variants::IPv6) + && !Core::App().settings().proxy() + .tryIPv6())) { + checker = nullptr; + return; + } + const auto &endpoint = list.front(); + setup(checker, endpoint.secret); + checker->connectToServer( + QString::fromStdString(endpoint.ip), + endpoint.port, + endpoint.secret, + dcId, + false); + }; + tryConnect(v4, Variants::IPv4); + tryConnect(v6, Variants::IPv6); + if (!v4 && !v6 && fail) { + fail(); + } + } + } +}; + } // namespace ProxiesBoxController::ProxiesBoxController(not_null account) @@ -1419,7 +1513,7 @@ void ProxiesBoxController::ShowApplyConfirmation( QString() ).replace(UrlEndRegExp, QString()); const auto box = [=](not_null box) { - box->setTitle(tr::lng_proxy_box_title()); + box->setTitle(tr::lng_proxy_box_table_title()); box->setStyle(st::proxyApplyBox); box->addTopButton(st::boxTitleClose, [=] { box->closeBox(); @@ -1463,6 +1557,51 @@ void ProxiesBoxController::ShowApplyConfirmation( add(proxy.password, tr::lng_proxy_box_secret()); } + { + const auto checker = box->lifetime().make_state< + ProxyChecker>(); + const auto statusValue = box->lifetime().make_state< + rpl::variable + >(Ui::Text::Link( + tr::lng_proxy_box_check_status(tr::now))); + const auto statusLabel = Ui::AddTableRow( + table, + tr::lng_proxy_box_status(), + statusValue->value()); + const auto relayout = [=] { + table->resizeToWidth(table->width()); + }; + statusLabel->setClickHandlerFilter([=](const auto &...) { + const auto account = controller + ? &controller->session().account() + : &Core::App().activeAccount(); + *statusValue = TextWithEntities{ + tr::lng_proxy_box_table_checking(tr::now), + }; + statusLabel->setTextColorOverride(st::creditsBg3->c); + relayout(); + checker->start(&account->mtp(), proxy, [=](int ping) { + *statusValue = TextWithEntities{ + tr::lng_proxy_box_table_available( + tr::now, + lt_ping, + QString::number(ping)), + }; + statusLabel->setTextColorOverride( + st::proxyRowStatusFgAvailable->c); + relayout(); + }, [=] { + *statusValue = TextWithEntities{ + tr::lng_proxy_box_table_unavailable(tr::now), + }; + statusLabel->setTextColorOverride( + st::proxyRowStatusFgOffline->c); + relayout(); + }); + return false; + }); + } + if (type == Type::Mtproto) { table->addRow( object_ptr( @@ -1475,7 +1614,7 @@ void ProxiesBoxController::ShowApplyConfirmation( } const auto enableButton = box->addButton( - tr::lng_sure_enable(), + tr::lng_proxy_box_table_button(), [=] { auto &proxies = Core::App().settings().proxy().list(); if (!ranges::contains(proxies, proxy)) { @@ -1519,9 +1658,9 @@ void ProxiesBoxController::refreshChecker(Item &item) { : Variants::Tcp; const auto mtproto = &_account->mtp(); const auto dcId = mtproto->mainDcId(); - const auto forFiles = false; item.state = ItemState::Checking; + const auto id = item.id; const auto setup = [&](Checker &checker, const bytes::vector &secret) { checker = MTP::details::AbstractConnection::Create( mtproto, @@ -1529,7 +1668,35 @@ void ProxiesBoxController::refreshChecker(Item &item) { QThread::currentThread(), secret, item.data); - setupChecker(item.id, checker); + using Connection = MTP::details::AbstractConnection; + const auto pointer = checker.get(); + pointer->connect(pointer, &Connection::connected, [=] { + const auto item = findById(id); + const auto pingTime = pointer->pingTime(); + item->checker = nullptr; + item->checkerv6 = nullptr; + if (item->state == ItemState::Checking) { + item->state = ItemState::Available; + item->ping = pingTime; + updateView(*item); + } + }); + const auto failed = [=] { + const auto item = findById(id); + if (item->checker == pointer) { + item->checker = nullptr; + } else if (item->checkerv6 == pointer) { + item->checkerv6 = nullptr; + } + if (!item->checker + && !item->checkerv6 + && item->state == ItemState::Checking) { + item->state = ItemState::Unavailable; + updateView(*item); + } + }; + pointer->connect(pointer, &Connection::disconnected, failed); + pointer->connect(pointer, &Connection::error, failed); }; if (item.data.type == Type::Mtproto) { const auto secret = item.data.secretFromMtprotoPassword(); @@ -1539,7 +1706,7 @@ void ProxiesBoxController::refreshChecker(Item &item) { item.data.port, secret, dcId, - forFiles); + false); item.checkerv6 = nullptr; } else { const auto options = mtproto->dcOptions().lookup( @@ -1563,7 +1730,7 @@ void ProxiesBoxController::refreshChecker(Item &item) { endpoint.port, endpoint.secret, dcId, - forFiles); + false); }; connect(item.checker, Variants::IPv4); connect(item.checkerv6, Variants::IPv6); @@ -1573,38 +1740,6 @@ void ProxiesBoxController::refreshChecker(Item &item) { } } -void ProxiesBoxController::setupChecker(int id, const Checker &checker) { - using Connection = MTP::details::AbstractConnection; - const auto pointer = checker.get(); - pointer->connect(pointer, &Connection::connected, [=] { - const auto item = findById(id); - const auto pingTime = pointer->pingTime(); - item->checker = nullptr; - item->checkerv6 = nullptr; - if (item->state == ItemState::Checking) { - item->state = ItemState::Available; - item->ping = pingTime; - updateView(*item); - } - }); - const auto failed = [=] { - const auto item = findById(id); - if (item->checker == pointer) { - item->checker = nullptr; - } else if (item->checkerv6 == pointer) { - item->checkerv6 = nullptr; - } - if (!item->checker - && !item->checkerv6 - && item->state == ItemState::Checking) { - item->state = ItemState::Unavailable; - updateView(*item); - } - }; - pointer->connect(pointer, &Connection::disconnected, failed); - pointer->connect(pointer, &Connection::error, failed); -} - object_ptr ProxiesBoxController::CreateOwningBox( not_null account, const QString &highlightId) { diff --git a/Telegram/SourceFiles/boxes/connection_box.h b/Telegram/SourceFiles/boxes/connection_box.h index fcbe5ad6f6..c33f8ea0f4 100644 --- a/Telegram/SourceFiles/boxes/connection_box.h +++ b/Telegram/SourceFiles/boxes/connection_box.h @@ -117,7 +117,6 @@ private: void share(const ProxyData &proxy, bool qr = false); void saveDelayed(); void refreshChecker(Item &item); - void setupChecker(int id, const Checker &checker); void replaceItemWith( std::vector::iterator which, From d3460cafd0ac6fe7bfd0994335cc7b690eef650b Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 3 Apr 2026 16:26:26 +0300 Subject: [PATCH 03/50] Removed duplicated code for ping checker from connection box. --- Telegram/SourceFiles/boxes/connection_box.cpp | 377 ++++++++---------- 1 file changed, 175 insertions(+), 202 deletions(-) diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index 07e5185dba..dd6b6686c0 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -38,7 +38,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/menu/menu_add_action_callback.h" #include "ui/widgets/menu/menu_add_action_callback_factory.h" #include "ui/widgets/popup_menu.h" -#include "ui/controls/table_rows.h" #include "ui/wrap/slide_wrap.h" #include "ui/wrap/table_layout.h" #include "ui/wrap/vertical_layout.h" @@ -49,7 +48,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "styles/style_layers.h" #include "styles/style_boxes.h" #include "styles/style_chat_helpers.h" -#include "styles/style_giveaway.h" #include "styles/style_info.h" #include "styles/style_menu_icons.h" #include "styles/style_settings.h" @@ -1355,99 +1353,96 @@ void ProxyBox::addLabel( st::proxyEditTitlePadding); } -struct ProxyChecker { - using Checker = MTP::details::ConnectionPointer; +using Connection = MTP::details::AbstractConnection; +using Checker = MTP::details::ConnectionPointer; - Checker v4; - Checker v6; - - void start( - not_null mtproto, - const ProxyData &proxy, - Fn done, - Fn fail) { - using Connection = MTP::details::AbstractConnection; - using Variants = MTP::DcOptions::Variants; +void ResetProxyCheckers(Checker &v4, Checker &v6) { + v4 = nullptr; + v6 = nullptr; +} +void DropProxyChecker(Checker &v4, Checker &v6, not_null raw) { + if (v4.get() == raw) { v4 = nullptr; + } else if (v6.get() == raw) { v6 = nullptr; - const auto connType = (proxy.type == ProxyData::Type::Http) - ? Variants::Http - : Variants::Tcp; - const auto dcId = mtproto->mainDcId(); - const auto setup = [&]( - Checker &checker, - const bytes::vector &secret) { - checker = Connection::Create( - mtproto, - connType, - QThread::currentThread(), - secret, - proxy); - const auto raw = checker.get(); - raw->connect(raw, &Connection::connected, [=] { - const auto ping = raw->pingTime(); - v4 = nullptr; - v6 = nullptr; - if (done) { - done(ping); - } - }); - const auto failed = [=] { - if (v4.get() == raw) { - v4 = nullptr; - } else if (v6.get() == raw) { - v6 = nullptr; - } - if (!v4 && !v6 && fail) { - fail(); - } - }; - raw->connect(raw, &Connection::disconnected, failed); - raw->connect(raw, &Connection::error, failed); - }; - if (proxy.type == ProxyData::Type::Mtproto) { - const auto secret = proxy.secretFromMtprotoPassword(); - setup(v4, secret); - v4->connectToServer( - proxy.host, - proxy.port, - secret, - dcId, - false); - } else { - const auto options = mtproto->dcOptions().lookup( - dcId, - MTP::DcType::Regular, - true); - const auto tryConnect = [&]( - Checker &checker, - Variants::Address address) { - const auto &list = options.data[address][connType]; - if (list.empty() - || ((address == Variants::IPv6) - && !Core::App().settings().proxy() - .tryIPv6())) { - checker = nullptr; - return; - } - const auto &endpoint = list.front(); - setup(checker, endpoint.secret); - checker->connectToServer( - QString::fromStdString(endpoint.ip), - endpoint.port, - endpoint.secret, - dcId, - false); - }; - tryConnect(v4, Variants::IPv4); - tryConnect(v6, Variants::IPv6); - if (!v4 && !v6 && fail) { - fail(); - } - } } -}; +} + +[[nodiscard]] bool HasProxyCheckers(const Checker &v4, const Checker &v6) { + return v4 || v6; +} + +void StartProxyCheck( + not_null mtproto, + const ProxyData &proxy, + Checker &v4, + Checker &v6, + Fn done, + Fn fail) { + using Variants = MTP::DcOptions::Variants; + + ResetProxyCheckers(v4, v6); + const auto connType = (proxy.type == ProxyData::Type::Http) + ? Variants::Http + : Variants::Tcp; + const auto dcId = mtproto->mainDcId(); + const auto setup = [&](Checker &checker, const bytes::vector &secret) { + checker = Connection::Create( + mtproto, + connType, + QThread::currentThread(), + secret, + proxy); + const auto raw = checker.get(); + raw->connect(raw, &Connection::connected, [=] { + if (done) { + done(raw, raw->pingTime()); + } + }); + const auto failed = [=] { + if (fail) { + fail(raw); + } + }; + raw->connect(raw, &Connection::disconnected, failed); + raw->connect(raw, &Connection::error, failed); + }; + if (proxy.type == ProxyData::Type::Mtproto) { + const auto secret = proxy.secretFromMtprotoPassword(); + setup(v4, secret); + v4->connectToServer( + proxy.host, + proxy.port, + secret, + dcId, + false); + return; + } + const auto options = mtproto->dcOptions().lookup( + dcId, + MTP::DcType::Regular, + true); + const auto tryConnect = [&](Checker &checker, Variants::Address address) { + const auto &list = options.data[address][connType]; + if (list.empty() + || ((address == Variants::IPv6) + && !Core::App().settings().proxy().tryIPv6())) { + checker = nullptr; + return; + } + const auto &endpoint = list.front(); + setup(checker, endpoint.secret); + checker->connectToServer( + QString::fromStdString(endpoint.ip), + endpoint.port, + endpoint.secret, + dcId, + false); + }; + tryConnect(v4, Variants::IPv4); + tryConnect(v6, Variants::IPv6); +} } // namespace @@ -1522,8 +1517,20 @@ void ProxiesBoxController::ShowApplyConfirmation( const auto table = box->addRow( object_ptr( box, - st::giveawayGiftCodeTable), - st::giveawayGiftCodeTableMargin); + st::proxyApplyBoxTable), + st::proxyApplyBoxTableMargin); + const auto addRow = [&]( + rpl::producer label, + object_ptr value) { + table->addRow( + object_ptr( + table, + std::move(label), + table->st().defaultLabel), + std::move(value), + st::proxyApplyBoxTableLabelMargin, + st::proxyApplyBoxTableValueMargin); + }; const auto add = [&]( const QString &value, rpl::producer label) { @@ -1538,12 +1545,9 @@ void ProxiesBoxController::ShowApplyConfirmation( {})), (oneLine ? table->st().defaultValue - : st::giveawayGiftCodeValueMultiline), + : st::proxyApplyBoxValueMultiline), st::defaultPopupMenu); - Ui::AddTableRow( - table, - std::move(label), - std::move(widget)); + addRow(std::move(label), std::move(widget)); } }; if (!displayServer.isEmpty()) { @@ -1558,46 +1562,73 @@ void ProxiesBoxController::ShowApplyConfirmation( } { - const auto checker = box->lifetime().make_state< - ProxyChecker>(); - const auto statusValue = box->lifetime().make_state< - rpl::variable - >(Ui::Text::Link( - tr::lng_proxy_box_check_status(tr::now))); - const auto statusLabel = Ui::AddTableRow( + struct ProxyCheckStatusState { + Checker v4; + Checker v6; + rpl::variable statusValue; + }; + const auto state + = box->lifetime().make_state(); + state->statusValue = Ui::Text::Link( + tr::lng_proxy_box_check_status(tr::now)); + const auto weak = base::make_weak(box); + auto statusWidget = object_ptr( table, - tr::lng_proxy_box_status(), - statusValue->value()); + state->statusValue.value(), + table->st().defaultValue, + st::defaultPopupMenu); + const auto statusLabel = statusWidget.data(); + addRow(tr::lng_proxy_box_status(), std::move(statusWidget)); const auto relayout = [=] { table->resizeToWidth(table->width()); }; - statusLabel->setClickHandlerFilter([=](const auto &...) { + const auto setUnavailable = [=] { + state->statusValue = TextWithEntities{ + tr::lng_proxy_box_table_unavailable(tr::now), + }; + statusLabel->setTextColorOverride( + st::proxyRowStatusFgOffline->c); + relayout(); + }; + const auto runCheck = [=] { const auto account = controller ? &controller->session().account() : &Core::App().activeAccount(); - *statusValue = TextWithEntities{ + state->statusValue = TextWithEntities{ tr::lng_proxy_box_table_checking(tr::now), }; - statusLabel->setTextColorOverride(st::creditsBg3->c); + statusLabel->setTextColorOverride(st::proxyRowStatusFg->c); relayout(); - checker->start(&account->mtp(), proxy, [=](int ping) { - *statusValue = TextWithEntities{ - tr::lng_proxy_box_table_available( - tr::now, - lt_ping, - QString::number(ping)), - }; - statusLabel->setTextColorOverride( - st::proxyRowStatusFgAvailable->c); - relayout(); - }, [=] { - *statusValue = TextWithEntities{ - tr::lng_proxy_box_table_unavailable(tr::now), - }; - statusLabel->setTextColorOverride( - st::proxyRowStatusFgOffline->c); - relayout(); - }); + StartProxyCheck( + &account->mtp(), + proxy, + state->v4, + state->v6, + [=](Connection *raw, int ping) { + DropProxyChecker(state->v4, state->v6, raw); + ResetProxyCheckers(state->v4, state->v6); + state->statusValue = TextWithEntities{ + tr::lng_proxy_box_table_available( + tr::now, + lt_ping, + QString::number(ping)), + }; + statusLabel->setTextColorOverride( + st::proxyRowStatusFgAvailable->c); + relayout(); + }, + [=](Connection *raw) { + DropProxyChecker(state->v4, state->v6, raw); + if (!HasProxyCheckers(state->v4, state->v6)) { + setUnavailable(); + } + }); + if (!HasProxyCheckers(state->v4, state->v6)) { + setUnavailable(); + } + }; + statusLabel->setClickHandlerFilter([=](const auto &...) { + runCheck(); return false; }); } @@ -1626,14 +1657,13 @@ void ProxiesBoxController::ShowApplyConfirmation( Local::writeSettings(); box->closeBox(); }); - box->events( - ) | rpl::on_next([=](not_null e) { + box->events() | rpl::on_next([=](not_null e) { if ((e->type() != QEvent::KeyPress) || !enableButton) { return; } const auto k = static_cast(e.get()); if (k->key() == Qt::Key_Enter || k->key() == Qt::Key_Return) { - enableButton->clicked(Qt::KeyboardModifiers(), Qt::LeftButton); + enableButton->clicked({}, Qt::LeftButton); } }, box->lifetime()); }; @@ -1652,91 +1682,34 @@ auto ProxiesBoxController::proxySettingsValue() const } void ProxiesBoxController::refreshChecker(Item &item) { - using Variants = MTP::DcOptions::Variants; - const auto type = (item.data.type == Type::Http) - ? Variants::Http - : Variants::Tcp; - const auto mtproto = &_account->mtp(); - const auto dcId = mtproto->mainDcId(); - item.state = ItemState::Checking; const auto id = item.id; - const auto setup = [&](Checker &checker, const bytes::vector &secret) { - checker = MTP::details::AbstractConnection::Create( - mtproto, - type, - QThread::currentThread(), - secret, - item.data); - using Connection = MTP::details::AbstractConnection; - const auto pointer = checker.get(); - pointer->connect(pointer, &Connection::connected, [=] { + StartProxyCheck( + &_account->mtp(), + item.data, + item.checker, + item.checkerv6, + [=](Connection *raw, int pingTime) { const auto item = findById(id); - const auto pingTime = pointer->pingTime(); - item->checker = nullptr; - item->checkerv6 = nullptr; + DropProxyChecker(item->checker, item->checkerv6, raw); + ResetProxyCheckers(item->checker, item->checkerv6); if (item->state == ItemState::Checking) { item->state = ItemState::Available; item->ping = pingTime; updateView(*item); } - }); - const auto failed = [=] { + }, + [=](Connection *raw) { const auto item = findById(id); - if (item->checker == pointer) { - item->checker = nullptr; - } else if (item->checkerv6 == pointer) { - item->checkerv6 = nullptr; - } - if (!item->checker - && !item->checkerv6 + DropProxyChecker(item->checker, item->checkerv6, raw); + if (!HasProxyCheckers(item->checker, item->checkerv6) && item->state == ItemState::Checking) { item->state = ItemState::Unavailable; updateView(*item); } - }; - pointer->connect(pointer, &Connection::disconnected, failed); - pointer->connect(pointer, &Connection::error, failed); - }; - if (item.data.type == Type::Mtproto) { - const auto secret = item.data.secretFromMtprotoPassword(); - setup(item.checker, secret); - item.checker->connectToServer( - item.data.host, - item.data.port, - secret, - dcId, - false); - item.checkerv6 = nullptr; - } else { - const auto options = mtproto->dcOptions().lookup( - dcId, - MTP::DcType::Regular, - true); - const auto connect = [&]( - Checker &checker, - Variants::Address address) { - const auto &list = options.data[address][type]; - if (list.empty() - || ((address == Variants::IPv6) - && !Core::App().settings().proxy().tryIPv6())) { - checker = nullptr; - return; - } - const auto &endpoint = list.front(); - setup(checker, endpoint.secret); - checker->connectToServer( - QString::fromStdString(endpoint.ip), - endpoint.port, - endpoint.secret, - dcId, - false); - }; - connect(item.checker, Variants::IPv4); - connect(item.checkerv6, Variants::IPv6); - if (!item.checker && !item.checkerv6) { - item.state = ItemState::Unavailable; - } + }); + if (!HasProxyCheckers(item.checker, item.checkerv6)) { + item.state = ItemState::Unavailable; } } From cf45065e15edfbf4d39c765cd8429c19f5819a92 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 3 Apr 2026 16:26:50 +0300 Subject: [PATCH 04/50] Guarded check-status callbacks in connection box. --- Telegram/SourceFiles/boxes/connection_box.cpp | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index dd6b6686c0..d056ebeaff 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/call_delayed.h" #include "base/qthelp_regex.h" #include "base/qthelp_url.h" +#include "base/weak_ptr.h" #include "core/application.h" #include "core/core_settings.h" #include "core/local_url_handlers.h" @@ -1566,6 +1567,7 @@ void ProxiesBoxController::ShowApplyConfirmation( Checker v4; Checker v6; rpl::variable statusValue; + bool finished = false; }; const auto state = box->lifetime().make_state(); @@ -1591,9 +1593,13 @@ void ProxiesBoxController::ShowApplyConfirmation( relayout(); }; const auto runCheck = [=] { + if (!weak) { + return; + } const auto account = controller ? &controller->session().account() : &Core::App().activeAccount(); + state->finished = false; state->statusValue = TextWithEntities{ tr::lng_proxy_box_table_checking(tr::now), }; @@ -1605,7 +1611,11 @@ void ProxiesBoxController::ShowApplyConfirmation( state->v4, state->v6, [=](Connection *raw, int ping) { + if (!weak || state->finished) { + return; + } DropProxyChecker(state->v4, state->v6, raw); + state->finished = true; ResetProxyCheckers(state->v4, state->v6); state->statusValue = TextWithEntities{ tr::lng_proxy_box_table_available( @@ -1618,12 +1628,17 @@ void ProxiesBoxController::ShowApplyConfirmation( relayout(); }, [=](Connection *raw) { + if (!weak || state->finished) { + return; + } DropProxyChecker(state->v4, state->v6, raw); if (!HasProxyCheckers(state->v4, state->v6)) { + state->finished = true; setUnavailable(); } }); if (!HasProxyCheckers(state->v4, state->v6)) { + state->finished = true; setUnavailable(); } }; @@ -1690,7 +1705,13 @@ void ProxiesBoxController::refreshChecker(Item &item) { item.checker, item.checkerv6, [=](Connection *raw, int pingTime) { - const auto item = findById(id); + const auto item = ranges::find( + _list, + id, + [](const Item &item) { return item.id; }); + if (item == end(_list)) { + return; + } DropProxyChecker(item->checker, item->checkerv6, raw); ResetProxyCheckers(item->checker, item->checkerv6); if (item->state == ItemState::Checking) { @@ -1700,7 +1721,13 @@ void ProxiesBoxController::refreshChecker(Item &item) { } }, [=](Connection *raw) { - const auto item = findById(id); + const auto item = ranges::find( + _list, + id, + [](const Item &item) { return item.id; }); + if (item == end(_list)) { + return; + } DropProxyChecker(item->checker, item->checkerv6, raw); if (!HasProxyCheckers(item->checker, item->checkerv6) && item->state == ItemState::Checking) { From 172bbb1b292b8376b65187676d201eda31c0357a Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 3 Apr 2026 23:41:25 +0300 Subject: [PATCH 05/50] Fixed crash on macOS 10.13. Regression was introduced in 8de878693d. --- Telegram/SourceFiles/platform/mac/tray_mac.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/platform/mac/tray_mac.mm b/Telegram/SourceFiles/platform/mac/tray_mac.mm index cd4af761df..26751a2c40 100644 --- a/Telegram/SourceFiles/platform/mac/tray_mac.mm +++ b/Telegram/SourceFiles/platform/mac/tray_mac.mm @@ -174,7 +174,12 @@ void UpdateIcon(const NSStatusItem *status) { return; } - const auto appearance = [NSApp effectiveAppearance]; + const auto appearance = [&] { + if (@available(macOS 10.14, *)) { + return [NSApp effectiveAppearance]; + } + return status.button.effectiveAppearance; + }(); const auto darkMode = [[appearance.name lowercaseString] containsString:@"dark"]; From 6d2cf80f1022a0624c1a44633dac4ca04d466471 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 3 Apr 2026 23:42:18 +0300 Subject: [PATCH 06/50] Clamped spellcheck cursor position to avoid Qt out-of-range warning. --- Telegram/lib_spellcheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/lib_spellcheck b/Telegram/lib_spellcheck index 98fb380701..6fa694087b 160000 --- a/Telegram/lib_spellcheck +++ b/Telegram/lib_spellcheck @@ -1 +1 @@ -Subproject commit 98fb380701a1342dc913c4835f2f6683993fde5d +Subproject commit 6fa694087b25e0a2cf997dfca9e54d327e031743 From 7011e205d5b1c047dd46c14386f7dafb30e5417d Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 3 Apr 2026 23:43:03 +0300 Subject: [PATCH 07/50] Guarded controls visibility update during panel opacity animation. --- Telegram/lib_ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/lib_ui b/Telegram/lib_ui index e52f856c10..68fe8040bf 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit e52f856c10887556cd7419077c462a0637746e56 +Subproject commit 68fe8040bf29b4c477069c80c99b4859e874c6e0 From c8d104459672567eecb90e25169fa6e343b1b0a1 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 4 Apr 2026 00:15:53 +0300 Subject: [PATCH 08/50] Decreased max rounding radius for history view top bar action buttons. --- .../SourceFiles/history/view/history_view_top_bar_widget.cpp | 2 +- Telegram/SourceFiles/info/info.style | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 7e92eeeb6e..bc5b2aec74 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -1077,7 +1077,7 @@ void TopBarWidget::updateControlsGeometry() { _delete->moveToLeft(buttonsLeft, selectedButtonsTop); { - const auto large = _forward->height() / 3; + const auto large = st::topBarActionButtonLargeRadius; const auto &buttonSt = st::defaultActiveButton; const auto small = buttonSt.radius ? buttonSt.radius diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index f50318db5f..837637739c 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -1074,6 +1074,7 @@ topBarInfo: IconButton(topBarSearch) { } topBarInfoActive: icon {{ "top_bar_profile", windowActiveTextFg }}; topBarActionSkip: 10px; +topBarActionButtonLargeRadius: 8px; topBarInfoButtonSize: size(52px, topBarHeight); topBarInfoButtonInnerSize: 42px; From d56c2c5fc3242cacb3bac991e9adad891f5961c9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 4 Apr 2026 09:12:56 +0700 Subject: [PATCH 09/50] Handle flood errors in managed bot creation. --- Telegram/SourceFiles/boxes/peers/create_managed_bot_box.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/peers/create_managed_bot_box.cpp b/Telegram/SourceFiles/boxes/peers/create_managed_bot_box.cpp index a5a3c6c065..04c1a66c8d 100644 --- a/Telegram/SourceFiles/boxes/peers/create_managed_bot_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/create_managed_bot_box.cpp @@ -391,10 +391,12 @@ void CreateManagedBotBox( tr::rich), u"managed_bots"_q); } + } else if (MTP::IsFloodError(error)) { + show->showToast(tr::lng_flood_error(tr::now)); } else { show->showToast(type); } - }).send(); + }).handleFloodErrors().send(); }; QObject::connect(username, &Ui::UsernameInput::changed, [=] { From 79263209b3e30882583a0e6e0c051fcc63206351 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 4 Apr 2026 09:13:10 +0700 Subject: [PATCH 10/50] Version 6.7.3. - Fix launch on older macOS versions. --- Telegram/Resources/uwp/AppX/AppxManifest.xml | 2 +- Telegram/Resources/winrc/Telegram.rc | 8 ++++---- Telegram/Resources/winrc/Updater.rc | 8 ++++---- Telegram/SourceFiles/core/version.h | 4 ++-- Telegram/build/version | 8 ++++---- changelog.txt | 4 ++++ 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml index d425fabc4d..7fff59cc2d 100644 --- a/Telegram/Resources/uwp/AppX/AppxManifest.xml +++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml @@ -10,7 +10,7 @@ + Version="6.7.3.0" /> Telegram Desktop Telegram Messenger LLP diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index 7300490b94..ffeb37979e 100644 --- a/Telegram/Resources/winrc/Telegram.rc +++ b/Telegram/Resources/winrc/Telegram.rc @@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 6,7,2,0 - PRODUCTVERSION 6,7,2,0 + FILEVERSION 6,7,3,0 + PRODUCTVERSION 6,7,3,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -62,10 +62,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram FZ-LLC" VALUE "FileDescription", "Telegram Desktop" - VALUE "FileVersion", "6.7.2.0" + VALUE "FileVersion", "6.7.3.0" VALUE "LegalCopyright", "Copyright (C) 2014-2026" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "6.7.2.0" + VALUE "ProductVersion", "6.7.3.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index e13443ed0f..8bf0a1ac20 100644 --- a/Telegram/Resources/winrc/Updater.rc +++ b/Telegram/Resources/winrc/Updater.rc @@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 6,7,2,0 - PRODUCTVERSION 6,7,2,0 + FILEVERSION 6,7,3,0 + PRODUCTVERSION 6,7,3,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -53,10 +53,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram FZ-LLC" VALUE "FileDescription", "Telegram Desktop Updater" - VALUE "FileVersion", "6.7.2.0" + VALUE "FileVersion", "6.7.3.0" VALUE "LegalCopyright", "Copyright (C) 2014-2026" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "6.7.2.0" + VALUE "ProductVersion", "6.7.3.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index d085c11c9b..b68b287ebc 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -22,7 +22,7 @@ constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"_cs; constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs; constexpr auto AppName = "Telegram Desktop"_cs; constexpr auto AppFile = "Telegram"_cs; -constexpr auto AppVersion = 6007002; -constexpr auto AppVersionStr = "6.7.2"; +constexpr auto AppVersion = 6007003; +constexpr auto AppVersionStr = "6.7.3"; constexpr auto AppBetaVersion = false; constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION; diff --git a/Telegram/build/version b/Telegram/build/version index 8fce414cb2..df609c9f39 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -1,7 +1,7 @@ -AppVersion 6007002 +AppVersion 6007003 AppVersionStrMajor 6.7 -AppVersionStrSmall 6.7.2 -AppVersionStr 6.7.2 +AppVersionStrSmall 6.7.3 +AppVersionStr 6.7.3 BetaChannel 0 AlphaVersion 0 -AppVersionOriginal 6.7.2 +AppVersionOriginal 6.7.3 diff --git a/changelog.txt b/changelog.txt index 99834adccb..09479a66d7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +6.7.3 (04.04.26) + +- Fix launch on older macOS versions. + 6.7.2 (03.04.26) - System audio capture for desktop sharing on macOS. From df71142949105169130435dad1cbbc5facfadb05 Mon Sep 17 00:00:00 2001 From: Roman Shishkin Date: Mon, 6 Apr 2026 01:22:25 +0300 Subject: [PATCH 11/50] Change proxy share link from t.me to tg:// deeplink --- Telegram/SourceFiles/boxes/connection_box.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index d056ebeaff..2d3e5395ce 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -76,7 +76,7 @@ using ProxyData = MTP::ProxyData; [[nodiscard]] QString ProxyDataToString(const ProxyData &proxy) { using Type = ProxyData::Type; - return u"https://t.me/"_q + return u"tg://"_q + (proxy.type == Type::Socks5 ? "socks" : "proxy") + "?server=" + proxy.host + "&port=" + QString::number(proxy.port) + ((proxy.type == Type::Socks5 && !proxy.user.isEmpty()) From 8fecab58a967e0d001aa899f2c1c4ca659e6f329 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 3 Apr 2026 15:55:31 +0700 Subject: [PATCH 12/50] [ai] Suggest non-style constants for durations. --- AGENTS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 3694a358a1..9fffd0a059 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -287,6 +287,8 @@ auto margin = st::myWidgetMargin; auto iconSize = st::myWidgetIconSize; ``` +**Duration constants**: Animation durations should NOT go in `.style` files, this is a legacy approach. Prefer `constexpr auto kName = crl::time(N)` in an anonymous namespace in the relevant `.cpp` file. + ### Usage in Code ```cpp From 6fc6bb48ff99d753e4985a12d945b40d533b672b Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 6 Apr 2026 14:23:19 +0700 Subject: [PATCH 13/50] Add info button to AI Tools box. --- Telegram/SourceFiles/boxes/boxes.style | 8 ++++++++ Telegram/SourceFiles/boxes/compose_ai_box.cpp | 11 +++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/boxes/boxes.style b/Telegram/SourceFiles/boxes/boxes.style index 4fd2e656c8..a0aa71757a 100644 --- a/Telegram/SourceFiles/boxes/boxes.style +++ b/Telegram/SourceFiles/boxes/boxes.style @@ -1330,3 +1330,11 @@ aiComposeBoxWithSend: Box(aiComposeBox) { buttonPadding: margins(16px, 12px, 66px, 12px); } aiComposeSendButtonSkip: 8px; +aiComposeBoxClose: IconButton(boxTitleClose) { + ripple: defaultRippleAnimation; +} +aiComposeBoxInfoButton: IconButton(boxTitleClose) { + icon: icon {{ "menu/info", boxTitleCloseFg }}; + iconOver: icon {{ "menu/info", boxTitleCloseFgOver }}; + ripple: defaultRippleAnimation; +} diff --git a/Telegram/SourceFiles/boxes/compose_ai_box.cpp b/Telegram/SourceFiles/boxes/compose_ai_box.cpp index 2fb272151a..6b7095edf9 100644 --- a/Telegram/SourceFiles/boxes/compose_ai_box.cpp +++ b/Telegram/SourceFiles/boxes/compose_ai_box.cpp @@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "main/main_session.h" #include "settings/sections/settings_premium.h" #include "spellcheck/platform/platform_language.h" +#include "ui/boxes/about_cocoon_box.h" #include "ui/boxes/choose_language_box.h" #include "ui/chat/chat_style.h" #include "ui/controls/labeled_emoji_tabs.h" @@ -1397,9 +1398,12 @@ void ComposeAiBox(not_null box, ComposeAiBoxArgs &&args) { box->setNoContentMargin(true); box->setWidth(st::boxWideWidth); const auto session = args.session; - box->addTopButton(st::boxTitleClose, [=] { + box->addTopButton(st::aiComposeBoxClose, [=] { box->closeBox(); }); + box->addTopButton(st::aiComposeBoxInfoButton, [=] { + box->uiShow()->show(Box(Ui::AboutCocoonBox)); + }); const auto body = box->verticalLayout(); const auto tabsSkip = QMargins(0, 0, 0, st::aiComposeBoxStyleTabsSkip); @@ -1493,9 +1497,12 @@ void ComposeAiBox(not_null box, ComposeAiBoxArgs &&args) { } *sendButton = nullptr; box->clearButtons(); - box->addTopButton(st::boxTitleClose, [=] { + box->addTopButton(st::aiComposeBoxClose, [=] { box->closeBox(); }); + box->addTopButton(st::aiComposeBoxInfoButton, [=] { + box->uiShow()->show(Box(Ui::AboutCocoonBox)); + }); if (*premiumFlooded) { auto helper = Ui::Text::CustomEmojiHelper(); From 9dce30e904f8a78c6b8381d97c98ffceb137af5c Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 6 Apr 2026 14:58:33 +0700 Subject: [PATCH 14/50] Allow emojify without selecting a style. --- Telegram/SourceFiles/boxes/compose_ai_box.cpp | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/boxes/compose_ai_box.cpp b/Telegram/SourceFiles/boxes/compose_ai_box.cpp index 6b7095edf9..8b20695ee0 100644 --- a/Telegram/SourceFiles/boxes/compose_ai_box.cpp +++ b/Telegram/SourceFiles/boxes/compose_ai_box.cpp @@ -387,6 +387,7 @@ private: void updatePinnedTabs(anim::type animated); void cancelRequest(); void request(); + void resetState(CardState state); void applyResult(Api::ComposeWithAi::Result &&result); void showError(const QString &error = {}); void notifyLoadingChanged(); @@ -1128,8 +1129,12 @@ void ComposeAiContent::updateTitles() { ? ToTitle(_to, currentTranslateStyleLabel()) : tr::lng_ai_compose_result(tr::now, tr::marked)) : tr::lng_ai_compose_original(tr::now, tr::marked)); + const auto emojifyOnlyMode = !hasResult + && (_mode == ComposeAiMode::Style) + && (_styleIndex < 0); _preview->setEmojifyVisible( - hasResult && (_mode != ComposeAiMode::Fix)); + (hasResult && (_mode != ComposeAiMode::Fix)) + || emojifyOnlyMode); _preview->setEmojifyChecked(_emojify); } @@ -1155,15 +1160,13 @@ void ComposeAiContent::cancelRequest() { void ComposeAiContent::request() { cancelRequest(); - if (_mode == ComposeAiMode::Style && _styleIndex < 0) { + if (_mode == ComposeAiMode::Style && _styleIndex < 0 && !_emojify) { + if (_state != CardState::Waiting) { + resetState(CardState::Waiting); + } return; } - _state = CardState::Loading; - _result = {}; - _preview->setState(CardState::Loading); - notifyLoadingChanged(); - updateTitles(); - notifyReadyChanged(); + resetState(CardState::Loading); auto request = Api::ComposeWithAi::Request{ .text = _original, @@ -1175,7 +1178,9 @@ void ComposeAiContent::request() { request.changeTone = currentTranslateStyle(); break; case ComposeAiMode::Style: - request.changeTone = _stylesData[_styleIndex].id; + if (_styleIndex >= 0) { + request.changeTone = _stylesData[_styleIndex].id; + } break; case ComposeAiMode::Fix: request.proofread = true; @@ -1202,6 +1207,15 @@ void ComposeAiContent::request() { }); } +void ComposeAiContent::resetState(CardState state) { + _state = state; + _result = {}; + _preview->setState(state); + notifyLoadingChanged(); + updateTitles(); + notifyReadyChanged(); +} + void ComposeAiContent::applyResult(Api::ComposeWithAi::Result &&result) { _result = std::move(result.resultText); if (_result.text.isEmpty()) { @@ -1532,7 +1546,8 @@ void ComposeAiBox(not_null box, ComposeAiBoxArgs &&args) { close(); }); } else if (content->mode() == ComposeAiMode::Style - && !content->hasStyleSelection()) { + && !content->hasStyleSelection() + && !content->hasResult()) { const auto btn = addApplyButton( *boxStyleNoSend, tr::lng_ai_compose_select_style(), nullptr); From 87877fb5066b1064ade7563aabc8bf41b87e4a6c Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 4 Apr 2026 16:22:40 +0300 Subject: [PATCH 15/50] [poll-view] Added paused state support for emoji and media. --- .../history/view/media/history_view_poll.cpp | 146 ++++++++++++++---- 1 file changed, 112 insertions(+), 34 deletions(-) diff --git a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp index e57dd90bb1..2ffe81952f 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp @@ -195,12 +195,14 @@ struct PollThumbnailData { [[nodiscard]] PollThumbnailData MakePollThumbnail( not_null poll, const PollAnswer &answer, - Window::SessionController::MessageContext messageContext); + Window::SessionController::MessageContext messageContext, + Fn paused = nullptr); [[nodiscard]] PollThumbnailData MakePollThumbnail( not_null poll, const PollMedia &media, - Window::SessionController::MessageContext messageContext) { + Window::SessionController::MessageContext messageContext, + Fn paused = nullptr) { auto result = PollThumbnailData(); if (!media) { return result; @@ -217,7 +219,8 @@ struct PollThumbnailData { if (media.document->sticker()) { result.thumbnail = Ui::MakeEmojiThumbnail( &poll->owner(), - Data::SerializeCustomEmojiId(media.document)); + Data::SerializeCustomEmojiId(media.document), + paused); result.kind = PollThumbnailKind::Emoji; } else if (media.document->isSong() || media.document->isVoiceMessage()) { @@ -289,8 +292,10 @@ struct PollThumbnailData { PollThumbnailData MakePollThumbnail( not_null poll, const PollAnswer &answer, - Window::SessionController::MessageContext messageContext) { - auto result = MakePollThumbnail(poll, answer.media, messageContext); + Window::SessionController::MessageContext messageContext, + Fn paused) { + auto result + = MakePollThumbnail(poll, answer.media, messageContext, paused); if (result.kind == PollThumbnailKind::Emoji && result.id) { const auto documentId = DocumentId(result.id); const auto option = answer.option; @@ -363,7 +368,8 @@ struct Poll::Answer { not_null poll, const PollAnswer &original, Window::SessionController::MessageContext messageContext, - Fn repaint); + Fn repaint, + Fn paused); Ui::Text::String text; QByteArray option; @@ -1734,11 +1740,13 @@ void Poll::Answer::fillMedia( not_null poll, const PollAnswer &original, Window::SessionController::MessageContext messageContext, - Fn repaint) { + Fn repaint, + Fn paused) { const auto updated = MakePollThumbnail( poll, original, - messageContext); + messageContext, + paused); const auto same = (updated.kind == thumbnailKind) && (updated.id == thumbnailId) && (updated.rounded == thumbnailRounded); @@ -2037,7 +2045,11 @@ void Poll::updateTexts() { options, Core::TextContext({ .session = &_poll->session(), - .repaint = [=] { repaint(); }, + .repaint = [=] { + if (!_parent->delegate()->elementAnimationsPaused()) { + repaint(); + } + }, .customEmojiLoopLimit = 2, })); } @@ -2097,7 +2109,11 @@ void Poll::Header::updateDescription() { } const auto context = Core::TextContext({ .session = &_owner->_poll->session(), - .repaint = [=] { _owner->_parent->customEmojiRepaint(); }, + .repaint = [=] { + if (!_owner->_parent->delegate()->elementAnimationsPaused()) { + _owner->_parent->customEmojiRepaint(); + } + }, .customEmojiLoopLimit = 2, }); _description.setMarkedText( @@ -2123,7 +2139,11 @@ void Poll::Header::updateSolutionText() { Ui::ItemTextOptions(_owner->_parent->data()), Core::TextContext({ .session = &_owner->_poll->session(), - .repaint = [=] { _owner->repaint(); }, + .repaint = [=] { + if (!_owner->_parent->delegate()->elementAnimationsPaused()) { + _owner->repaint(); + } + }, })); InitElementTextPart(_owner->_parent, _solutionText); } @@ -2135,10 +2155,14 @@ void Poll::Header::updateSolutionMedia() { .topicRootId = item->topicRootId(), .monoforumPeerId = item->sublistPeerId(), }; + const auto paused = [=] { + return _owner->_parent->delegate()->elementAnimationsPaused(); + }; const auto updated = MakePollThumbnail( _owner->_poll, _owner->_poll->solutionMedia, - messageContext); + messageContext, + paused); if (!updated.thumbnail) { _solutionMedia = nullptr; _solutionAttach = nullptr; @@ -2186,10 +2210,14 @@ void Poll::Header::updateAttachedMedia() { .topicRootId = item->topicRootId(), .monoforumPeerId = item->sublistPeerId(), }; + const auto paused = [=] { + return _owner->_parent->delegate()->elementAnimationsPaused(); + }; const auto updated = MakePollThumbnail( _owner->_poll, _owner->_poll->attachedMedia, - messageContext); + messageContext, + paused); const auto same = (_attachedMedia->kind == updated.kind) && (_attachedMedia->id == updated.id) && (_attachedMedia->rounded == updated.rounded); @@ -2217,8 +2245,8 @@ void Poll::Header::updateAttachedMedia() { _owner->_parent->data()->fullId()); if (const auto size = photo->size(Data::PhotoSize::Large)) { _attachedMedia->photoSize = *size; - } else if (const auto size = photo->size(Data::PhotoSize::Thumbnail)) { - _attachedMedia->photoSize = *size; + } else if (const auto s = photo->size(Data::PhotoSize::Thumbnail)) { + _attachedMedia->photoSize = *s; } } if ((updated.kind == PollThumbnailKind::Document @@ -2235,8 +2263,10 @@ void Poll::Header::updateAttachedMedia() { if (_attachedMedia->thumbnail) { _attachedMedia->thumbnail->subscribeToUpdates( crl::guard(_owner, [=] { - _attachedMediaCache = QImage(); - _owner->repaint(); + if (!_owner->_parent->delegate()->elementAnimationsPaused()) { + _attachedMediaCache = QImage(); + _owner->repaint(); + } })); } } @@ -2418,28 +2448,35 @@ uint16 Poll::Header::solutionSelectionLength() const { : uint16(0); } -TextSelection Poll::Header::toSolutionSelection(TextSelection selection) const { +TextSelection Poll::Header::toSolutionSelection( + TextSelection selection) const { return UnshiftItemSelection(selection, _description); } -TextSelection Poll::Header::fromSolutionSelection(TextSelection selection) const { +TextSelection Poll::Header::fromSolutionSelection( + TextSelection selection) const { return ShiftItemSelection(selection, _description); } -TextSelection Poll::Header::toQuestionSelection(TextSelection selection) const { +TextSelection Poll::Header::toQuestionSelection( + TextSelection selection) const { return UnshiftItemSelection( selection, uint16(_description.length() + solutionSelectionLength())); } -TextSelection Poll::Header::fromQuestionSelection(TextSelection selection) const { +TextSelection Poll::Header::fromQuestionSelection( + TextSelection selection) const { return ShiftItemSelection( selection, uint16(_description.length() + solutionSelectionLength())); } void Poll::Options::checkQuizAnswered() { - if (!_owner->_voted || !_votedFromHere || !_owner->_poll->quiz() || anim::Disabled()) { + if (!_owner->_voted + || !_votedFromHere + || !_owner->_poll->quiz() + || anim::Disabled()) { return; } const auto i = ranges::find(_answers, true, &Answer::chosen); @@ -2529,10 +2566,21 @@ void Poll::Header::updateRecentVoters() { void Poll::Options::updateAnswers() { const auto context = Core::TextContext({ .session = &_owner->_poll->session(), - .repaint = [=] { _owner->repaint(); }, + .repaint = [=] { + if (!_owner->_parent->delegate()->elementAnimationsPaused()) { + _owner->repaint(); + } + }, .customEmojiLoopLimit = 2, }); - const auto repaintThumbnail = crl::guard(_owner, [=] { _owner->repaint(); }); + const auto repaintThumbnail = crl::guard(_owner, [=] { + if (!_owner->_parent->delegate()->elementAnimationsPaused()) { + _owner->repaint(); + } + }); + const auto paused = [=] { + return _owner->_parent->delegate()->elementAnimationsPaused(); + }; const auto item = _owner->_parent->data(); const auto messageContext = Window::SessionController::MessageContext{ .id = item->fullId(), @@ -2566,7 +2614,12 @@ void Poll::Options::updateAnswers() { &PollAnswer::option); Assert(i != end(_owner->_poll->answers)); answer.fillData(_owner->_poll, *i, context); - answer.fillMedia(_owner->_poll, *i, messageContext, repaintThumbnail); + answer.fillMedia( + _owner->_poll, + *i, + messageContext, + repaintThumbnail, + paused); } _anyAnswerHasMedia = ranges::any_of(_answers, [](const Answer &a) { return a.thumbnail != nullptr; @@ -2583,7 +2636,12 @@ void Poll::Options::updateAnswers() { &PollAnswer::option); Assert(i != end(_owner->_poll->answers)); result.fillData(_owner->_poll, *i, context); - result.fillMedia(_owner->_poll, *i, messageContext, repaintThumbnail); + result.fillMedia( + _owner->_poll, + *i, + messageContext, + repaintThumbnail, + paused); return result; }) | ranges::to_vector; @@ -2992,7 +3050,9 @@ void Poll::Header::paintSolutionBlock( } if (!_closeSolutionLink) { _closeSolutionLink = std::make_shared( - crl::guard(_owner, [=] { _owner->_headerPart->solutionToggled(false); })); + crl::guard( + _owner, + [=] { _owner->_headerPart->solutionToggled(false); })); } const auto &qst = st::historyPagePreview; @@ -3373,11 +3433,15 @@ void Poll::Options::paintRadio( const auto o = p.opacity(); if (checkmark < 1.) { p.setBrush(Qt::NoBrush); - p.setOpacity(o * (over ? st::historyPollRadioOpacityOver : st::historyPollRadioOpacity)); + p.setOpacity(o + * (over + ? st::historyPollRadioOpacityOver + : st::historyPollRadioOpacity)); } const auto multiChoice = (_owner->_flags & PollData::Flag::MultiChoice); - const auto rect = QRectF(left, top, radio.diameter, radio.diameter).marginsRemoved(QMarginsF(radio.thickness / 2., radio.thickness / 2., radio.thickness / 2., radio.thickness / 2.)); + const auto rect = QRectF(left, top, radio.diameter, radio.diameter) + - Margins(radio.thickness / 2.); const auto radius = st::historyPollCheckboxRadius; if (_sendingAnimation && _sendingAnimation->option == answer.option) { const auto &active = stm->msgServiceFg; @@ -3424,7 +3488,11 @@ void Poll::Options::paintRadio( p.drawEllipse(inner); } const auto &icon = stm->historyPollChosen; - icon.paint(p, left + (radio.diameter - icon.width()) / 2, top + (radio.diameter - icon.height()) / 2, _owner->width()); + icon.paint( + p, + left + (radio.diameter - icon.width()) / 2, + top + (radio.diameter - icon.height()) / 2, + _owner->width()); } } @@ -3448,7 +3516,12 @@ void Poll::Options::paintPercent( p.setFont(st::historyPollPercentFont); p.setPen(stm->historyTextFg); const auto pleft = aleft - percentWidth - st::historyPollPercentSkip; - p.drawTextLeft(pleft, top + st::historyPollPercentTop, outerWidth, percent, percentWidth); + p.drawTextLeft( + pleft, + top + st::historyPollPercentTop, + outerWidth, + percent, + percentWidth); } void Poll::Options::paintFilling( @@ -3471,7 +3544,8 @@ void Poll::Options::paintFilling( const auto thickness = st::historyPollFillingHeight; const auto max = contentWidth - st::historyPollFillingRight; - const auto size = anim::interpolate(st::historyPollFillingMin, max, filling); + const auto size + = anim::interpolate(st::historyPollFillingMin, max, filling); const auto radius = st::historyPollFillingRadius; const auto ftop = top + std::max(st::historyPollPercentFont->height, contentHeight) @@ -3485,7 +3559,10 @@ void Poll::Options::paintFilling( const auto style = [&] { if (chosen && !correct) { return Style::Incorrect; - } else if (chosen && correct && _owner->_poll->quiz() && !context.outbg) { + } else if (chosen + && correct + && _owner->_poll->quiz() + && !context.outbg) { return Style::Correct; } else { return Style::Default; @@ -3600,7 +3677,8 @@ bool Poll::Options::checkAnimationStart() const { // Skip initial changes. return false; } - const auto result = (_owner->showVotes() != (_owner->_poll->voted() || _owner->_poll->closed())) + const auto result = _owner->showVotes() + != (_owner->_poll->voted() || _owner->_poll->closed()) || answerVotesChanged(); if (result) { saveStateInAnimation(); From ec312a1f15f5881bb013f3cca66068b4596d0c88 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 4 Apr 2026 16:48:40 +0300 Subject: [PATCH 16/50] Forbidden multi-selection menu for monoforums in share box. --- .../SourceFiles/window/window_peer_menu.cpp | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index b1883ae8fb..3f3cbfda6d 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -2639,9 +2639,11 @@ object_ptr PrepareChooseRecipientBox( return ChooseRecipientBoxController::rowClicked(row); } const auto count = delegate()->peerListSelectedRowsCount(); - if (showLockedError(row) || (count && row->peer()->isForum())) { + const auto forum = row->peer()->isForum(); + const auto monoforum = row->peer()->isMonoforum(); + if (showLockedError(row) || (count && (forum || monoforum))) { return; - } else if (row->peer()->isForum()) { + } else if (forum || monoforum) { ChooseRecipientBoxController::rowClicked(row); } else { delegate()->peerListSetRowChecked(row, !row->checked()); @@ -2657,7 +2659,9 @@ object_ptr PrepareChooseRecipientBox( parent, row); } - if (!row->checked() && !row->peer()->isForum()) { + if (!row->checked() + && !row->peer()->isForum() + && !row->peer()->isMonoforum()) { auto menu = base::make_unique_q( parent, st::popupMenuWithIcons); @@ -2942,9 +2946,11 @@ base::weak_qptr ShowForwardMessagesBox( void rowClicked(not_null row) override final { const auto count = delegate()->peerListSelectedRowsCount(); - if (showLockedError(row) || (count && row->peer()->isForum())) { + const auto forum = row->peer()->isForum(); + const auto monoforum = row->peer()->isMonoforum(); + if (showLockedError(row) || (count && (forum || monoforum))) { return; - } else if (!count || row->peer()->isForum()) { + } else if (!count || forum || monoforum) { ChooseRecipientBoxController::rowClicked(row); } else if (count) { delegate()->peerListSetRowChecked(row, !row->checked()); @@ -2955,7 +2961,9 @@ base::weak_qptr ShowForwardMessagesBox( base::unique_qptr rowContextMenu( QWidget *parent, not_null row) override final { - if (!row->checked() && !row->peer()->isForum()) { + if (!row->checked() + && !row->peer()->isForum() + && !row->peer()->isMonoforum()) { auto menu = base::make_unique_q( parent, st::popupMenuWithIcons); From 5d557b44e44be79e7c7732384bfa9540bbd94f7f Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 4 Apr 2026 17:30:49 +0300 Subject: [PATCH 17/50] Replaced heavy Qt opacity effect with FadeWrap in info profile top bar. --- .../info/profile/info_profile_top_bar.cpp | 48 +++++++++---------- .../info/profile/info_profile_top_bar.h | 5 +- Telegram/lib_ui | 2 +- 3 files changed, 24 insertions(+), 31 deletions(-) diff --git a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp index ba6f2fdc66..be55f17a7f 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp @@ -103,7 +103,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "styles/style_menu_icons.h" #include "styles/style_settings.h" -#include #include #include @@ -326,8 +325,10 @@ TopBar::TopBar( , _statusLabel(std::make_unique(_status.data(), _peer)) , _showLastSeen( this, - tr::lng_status_lastseen_when(), - st::infoProfileTopBarShowLastSeen) + object_ptr( + this, + tr::lng_status_lastseen_when(), + st::infoProfileTopBarShowLastSeen)) , _forumButton([&, controller = descriptor.controller] { const auto topic = _key.topic(); if (!topic) { @@ -511,14 +512,14 @@ void TopBar::adjustColors(const std::optional &edgeColor) { : shouldOverrideTitle ? std::optional(st::groupCallMembersFg->c) : std::nullopt); - if (!_showLastSeen->isHidden()) { + if (_showLastSeen->toggled()) { if (shouldOverrideTitle) { const auto st = mapActionStyle(edgeColor); - _showLastSeen->setBrushOverride(st.bgColor); - _showLastSeen->setTextFgOverride(st.fgColor); + _showLastSeen->entity()->setBrushOverride(st.bgColor); + _showLastSeen->entity()->setTextFgOverride(st.fgColor); } else { - _showLastSeen->setBrushOverride(std::nullopt); - _showLastSeen->setTextFgOverride(std::nullopt); + _showLastSeen->entity()->setBrushOverride(std::nullopt); + _showLastSeen->entity()->setTextFgOverride(std::nullopt); } } { @@ -1677,7 +1678,7 @@ void TopBar::updateStatusPosition(float64 progressCurrent) { _status->hide(); // _starsRating->hide(); - _showLastSeen->hide(); + _showLastSeen->hide(anim::type::instant); return; } @@ -1687,7 +1688,7 @@ void TopBar::updateStatusPosition(float64 progressCurrent) { progressCurrent); const auto totalElementsWidth = _status->width() + (_starsRating ? _starsRating->width() : 0) - + (!_showLastSeen->isHidden() ? _showLastSeen->width() : 0); + + (_showLastSeen->toggled() ? _showLastSeen->width() : 0); const auto statusLeft = anim::interpolate( statusMostLeft(), (width() - totalElementsWidth) / 2, @@ -1702,17 +1703,15 @@ void TopBar::updateStatusPosition(float64 progressCurrent) { _status->moveToLeft(statusLeft + statusShift, statusTop); - if (!_showLastSeen->isHidden()) { + if (_showLastSeen->toggled()) { _showLastSeen->moveToLeft( statusLeft + statusShift + _status->textMaxWidth() + st::infoProfileTopBarLastSeenSkip.x(), statusTop + st::infoProfileTopBarLastSeenSkip.y()); - if (_showLastSeenOpacity) { - _showLastSeenOpacity->setOpacity(progressCurrent); - } - _showLastSeen->setAttribute( + _showLastSeen->setOpacity(progressCurrent); + _showLastSeen->entity()->setAttribute( Qt::WA_TransparentForMouseEvents, !progressCurrent); } @@ -2092,7 +2091,7 @@ void TopBar::setupShowLastSeen( || user->isBot() || user->isServiceUser() || !user->session().premiumPossible()) { - _showLastSeen->hide(); + _showLastSeen->hide(anim::type::instant); return; } @@ -2100,7 +2099,7 @@ void TopBar::setupShowLastSeen( if (user->lastseen().isHiddenByMe()) { user->updateFullForced(); } - _showLastSeen->hide(); + _showLastSeen->hide(anim::type::instant); return; } @@ -2110,13 +2109,13 @@ void TopBar::setupShowLastSeen( Data::PeerUpdate::Flag::OnlineStatus), Data::AmPremiumValue(&user->session()) ) | rpl::on_next([=](auto, bool premium) { - const auto wasShown = !_showLastSeen->isHidden(); + const auto wasShown = _showLastSeen->toggled(); const auto hiddenByMe = user->lastseen().isHiddenByMe(); const auto shown = hiddenByMe && !user->lastseen().isOnline(base::unixtime::now()) && !premium && user->session().premiumPossible(); - _showLastSeen->setVisible(shown); + _showLastSeen->toggle(shown, anim::type::instant); if (wasShown && premium && hiddenByMe) { user->updateFullForced(); } @@ -2132,16 +2131,13 @@ void TopBar::setupShowLastSeen( } }, _showLastSeen->lifetime()); - _showLastSeenOpacity = Ui::CreateChild( - _showLastSeen.get()); - _showLastSeen->setGraphicsEffect(_showLastSeenOpacity); - _showLastSeenOpacity->setOpacity(0.); + _showLastSeen->setOpacity(0.); using TextTransform = Ui::RoundButton::TextTransform; - _showLastSeen->setTextTransform(TextTransform::NoTransform); - _showLastSeen->setFullRadius(true); + _showLastSeen->entity()->setTextTransform(TextTransform::NoTransform); + _showLastSeen->entity()->setFullRadius(true); - _showLastSeen->setClickedCallback([=] { + _showLastSeen->entity()->setClickedCallback([=] { const auto type = Ui::ShowOrPremium::LastSeen; controller->show(Box( Ui::ShowOrPremiumBox, diff --git a/Telegram/SourceFiles/info/profile/info_profile_top_bar.h b/Telegram/SourceFiles/info/profile/info_profile_top_bar.h index 201f90e675..9139387242 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_top_bar.h +++ b/Telegram/SourceFiles/info/profile/info_profile_top_bar.h @@ -52,8 +52,6 @@ struct InfoPeerBadge; struct FlatLabel; } //namespace style -class QGraphicsOpacityEffect; - namespace Ui { class FlatLabel; class IconButton; @@ -223,9 +221,8 @@ private: object_ptr _status; std::unique_ptr _statusLabel; rpl::variable _statusShift = 0; - object_ptr _showLastSeen = { nullptr }; + object_ptr> _showLastSeen = { nullptr }; object_ptr _forumButton = { nullptr }; - QGraphicsOpacityEffect *_showLastSeenOpacity = nullptr; std::shared_ptr _statusSt; std::shared_ptr _botVerifySt; diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 68fe8040bf..b76a4f4a59 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 68fe8040bf29b4c477069c80c99b4859e874c6e0 +Subproject commit b76a4f4a59c5a1c635aa455361aef8075ceeec4b From 18ea990e7a5512245d3f313bb603cb3c97456dba Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 4 Apr 2026 17:43:32 +0300 Subject: [PATCH 18/50] Replaced panel animation with FadeWrap for media preview menus. --- .../view/history_view_reaction_preview.cpp | 65 ++++++++++++------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_reaction_preview.cpp b/Telegram/SourceFiles/history/view/history_view_reaction_preview.cpp index 310d47c38e..32d1af5279 100644 --- a/Telegram/SourceFiles/history/view/history_view_reaction_preview.cpp +++ b/Telegram/SourceFiles/history/view/history_view_reaction_preview.cpp @@ -24,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/dropdown_menu.h" #include "ui/widgets/labels.h" #include "ui/widgets/shadow.h" +#include "ui/wrap/fade_wrap.h" #include "ui/painter.h" #include "ui/rect.h" #include "ui/text/text_utilities.h" @@ -56,7 +57,7 @@ void SetupOverlayHideOnEscape( struct PreviewOverlayState { base::unique_qptr mediaPreview; base::unique_qptr clickable; - base::unique_qptr menu; + base::unique_qptr> menuWrap; base::unique_qptr background; base::unique_qptr label; Fn extraHide; @@ -64,7 +65,7 @@ struct PreviewOverlayState { void clear() { shutdownGuard.destroy(); - menu.reset(); + menuWrap.reset(); background.reset(); label.reset(); mediaPreview.reset(); @@ -131,18 +132,23 @@ void SetupPreviewMenu( const auto mainwidget = controller->widget()->bodyWidget(); if (fillMenu) { state->mediaPreview->setHideEmoji(true); - state->menu = base::make_unique_q( + auto menu = object_ptr( mainwidget, st::dropdownMenuWithIcons); - state->menu->setAutoHiding(false); - state->menu->setHiddenCallback( + menu->setAutoHiding(false); + menu->setHiddenCallback( crl::guard(state->clickable.get(), overlay.hideAll)); - fillMenu(state->menu.get()); + fillMenu(menu.data()); + state->menuWrap = base::make_unique_q>( + mainwidget, + std::move(menu)); + state->menuWrap->setDuration(st::defaultToggle.duration); + state->menuWrap->hide(anim::type::instant); } - const auto menuRaw = state->menu.get(); + const auto wrapRaw = state->menuWrap.get(); state->extraHide = [=] { - if (menuRaw) { - menuRaw->hideAnimated(); + if (wrapRaw) { + wrapRaw->hide(anim::type::normal); } }; @@ -150,7 +156,9 @@ void SetupPreviewMenu( mainwidget->sizeValue() | rpl::on_next([=](QSize size) { mediaPreviewRaw->setGeometry(Rect(size)); - if (menuRaw) { + if (wrapRaw) { + const auto menuRaw = wrapRaw->entity(); + menuRaw->showFast(); const auto gap = st::defaultMenu.itemPadding.top(); const auto menuH = menuRaw->height(); const auto shift = -(gap + menuH) / 2; @@ -158,9 +166,9 @@ void SetupPreviewMenu( const auto menuX = (size.width() - menuRaw->width()) / 2; const auto menuY = mediaPreviewRaw->contentBottom() + gap; - menuRaw->move(menuX, menuY); - menuRaw->showAnimated(Ui::PanelAnimation::Origin::TopLeft); - menuRaw->raise(); + wrapRaw->move(menuX, menuY); + wrapRaw->show(anim::type::normal); + wrapRaw->raise(); } }, mediaPreviewRaw->lifetime()); } @@ -309,7 +317,7 @@ void ShowWidgetPreview( struct State { base::unique_qptr preview; base::unique_qptr clickable; - base::unique_qptr menu; + base::unique_qptr> menuWrap; }; const auto state = std::make_shared(); const auto mainwidget = controller->widget()->bodyWidget(); @@ -326,28 +334,33 @@ void ShowWidgetPreview( const auto hideAll = [=] { state->clickable->setAttribute(Qt::WA_TransparentForMouseEvents); - if (state->menu) { - state->menu->hideAnimated(); + if (state->menuWrap) { + state->menuWrap->hide(anim::type::normal); } base::call_delayed( st::defaultToggle.duration, [s = state] { s->preview.reset(); - s->menu.reset(); + s->menuWrap.reset(); s->clickable.reset(); }); }; SetupOverlayHideOnEscape(state->clickable.get(), hideAll); - state->menu = base::make_unique_q( + auto menu = object_ptr( mainwidget, st::dropdownMenuWithIcons); - state->menu->setAutoHiding(false); - state->menu->setHiddenCallback( + menu->setAutoHiding(false); + menu->setHiddenCallback( crl::guard(state->clickable.get(), hideAll)); - fillMenu(state->menu.get()); + fillMenu(menu.data()); + state->menuWrap = base::make_unique_q>( + mainwidget, + std::move(menu)); + state->menuWrap->setDuration(st::defaultToggle.duration); + state->menuWrap->hide(anim::type::instant); - const auto menuRaw = state->menu.get(); + const auto wrapRaw = state->menuWrap.get(); state->clickable->show(); previewRaw->show(); @@ -363,17 +376,19 @@ void ShowWidgetPreview( state->clickable->setGeometry(Rect(size)); state->clickable->raise(); + const auto menuRaw = wrapRaw->entity(); + menuRaw->showFast(); const auto gap = st::defaultMenu.itemPadding.top(); const auto totalH = fullH + gap + menuRaw->height(); const auto previewY = (size.height() - totalH) / 2; previewRaw->move((size.width() - fullW) / 2, previewY); previewRaw->raise(); - menuRaw->move( + wrapRaw->move( (size.width() - menuRaw->width()) / 2, previewY + fullH + gap); - menuRaw->showAnimated(Ui::PanelAnimation::Origin::TopLeft); - menuRaw->raise(); + wrapRaw->show(anim::type::normal); + wrapRaw->raise(); }, previewRaw->lifetime()); } From ae4e5ad54a8e93d8bc96316de13661f41be96906 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 4 Apr 2026 17:56:42 +0300 Subject: [PATCH 19/50] Fixed preserving markers after video quality switch in media view. --- .../media/view/media_view_overlay_widget.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index c8f073f6e1..034aeaa31f 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -5241,11 +5241,14 @@ void OverlayWidget::applyVideoQuality(VideoQuality value) { const auto startStreaming = StartStreaming(false, time); if (!canInitStreaming() || !initStreaming(startStreaming)) { redisplayContent(); - } else if (_fullScreenVideo != wasFullScreen) { - _fullScreenVideo = wasFullScreen; - if (_streamed->controls) { - _streamed->controls->setInFullScreen(_fullScreenVideo); + } else { + if (_fullScreenVideo != wasFullScreen) { + _fullScreenVideo = wasFullScreen; + if (_streamed->controls) { + _streamed->controls->setInFullScreen(_fullScreenVideo); + } } + refreshCaption(); } } From 9caeea7edd4913f171283cbc477942881d5a2529 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 4 Apr 2026 18:12:54 +0300 Subject: [PATCH 20/50] Changed fallback color for mention icon in dialogs. --- Telegram/lib_ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/lib_ui b/Telegram/lib_ui index b76a4f4a59..801ce21201 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit b76a4f4a59c5a1c635aa455361aef8075ceeec4b +Subproject commit 801ce2120114011d59c9da72fe9751b4b1d182d5 From a7745a2086238daf053c706f2870513bccb1b80e Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 08:24:03 +0300 Subject: [PATCH 21/50] Slightly improved detect of non-discrete wheel event in flexible scroll. --- Telegram/SourceFiles/info/info_flexible_scroll.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/info/info_flexible_scroll.cpp b/Telegram/SourceFiles/info/info_flexible_scroll.cpp index 24255dae5a..3730e04fac 100644 --- a/Telegram/SourceFiles/info/info_flexible_scroll.cpp +++ b/Telegram/SourceFiles/info/info_flexible_scroll.cpp @@ -242,7 +242,7 @@ void FlexibleScrollHelper::setupScrollHandlingWithFilter() { } const auto wheel = static_cast(e.get()); const auto delta = wheel->angleDelta().y(); - if (std::abs(delta) != 120) { + if (std::abs(delta) != 120 || (wheel->phase() != Qt::NoScrollPhase)) { scrollToY(_scroll->scrollTop() - delta); return base::EventFilterResult::Cancel; } From 3884348e07a4a91e2c7118786f6e007021379938 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 08:37:49 +0300 Subject: [PATCH 22/50] Fixed top bar buttons appearing without animation on select messages. --- .../SourceFiles/history/view/history_view_top_bar_widget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 bc5b2aec74..a80e5ed695 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -1413,7 +1413,8 @@ void TopBarWidget::showSelected(SelectedState state) { _delete->finishNumbersAnimation(); } } - if (visibilityChanged) { + if (visibilityChanged + || (!wasSelectedState && nowSelectedState)) { updateControlsVisibility(); } if (wasSelectedState != nowSelectedState && !_chooseForReportReason) { From 00154dcbe9df07522aab5c6c47434e36425e4bc9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 6 Apr 2026 15:21:14 +0700 Subject: [PATCH 23/50] Fix glitch in empty managed bot username. --- Telegram/SourceFiles/boxes/peers/create_managed_bot_box.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Telegram/SourceFiles/boxes/peers/create_managed_bot_box.cpp b/Telegram/SourceFiles/boxes/peers/create_managed_bot_box.cpp index 04c1a66c8d..2897ce904a 100644 --- a/Telegram/SourceFiles/boxes/peers/create_managed_bot_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/create_managed_bot_box.cpp @@ -125,6 +125,7 @@ void CreateManagedBotBox( tr::lng_create_bot_username_placeholder(), initialUsername, QString()); + username->setPlaceholderHidden(true); username->setMaxLength( Ui::EditPeer::kMaxUsernameLength - int(botSuffixText.size())); usernameWrap->widthValue() | rpl::on_next([=](int width) { @@ -133,6 +134,7 @@ void CreateManagedBotBox( username->heightValue() | rpl::on_next([=](int height) { usernameWrap->resize(usernameWrap->width(), height); }, username->lifetime()); + username->finishAnimating(); const auto botPrefix = Ui::CreateChild( username, From 300e0f2fb79d1ccd017afa5ec297028a17644227 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 6 Apr 2026 15:21:52 +0700 Subject: [PATCH 24/50] Fix unicode name value in bot create deeplink. --- Telegram/SourceFiles/core/deep_links/deep_links_router.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/core/deep_links/deep_links_router.cpp b/Telegram/SourceFiles/core/deep_links/deep_links_router.cpp index cb045bc498..4cdeabb64f 100644 --- a/Telegram/SourceFiles/core/deep_links/deep_links_router.cpp +++ b/Telegram/SourceFiles/core/deep_links/deep_links_router.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "core/deep_links/deep_links_router.h" +#include "base/qthelp_url.h" #include "core/deep_links/deep_links_chats.h" #include "core/deep_links/deep_links_contacts.h" #include "core/deep_links/deep_links_new.h" @@ -33,7 +34,7 @@ Context ParseCommand( for (const auto &pair : query.split('&')) { const auto eq = pair.indexOf('='); if (eq > 0) { - result.params[pair.left(eq).toLower()] = pair.mid(eq + 1); + result.params[pair.left(eq).toLower()] = qthelp::url_decode(pair.mid(eq + 1)); } else if (!pair.isEmpty()) { result.params[pair.toLower()] = QString(); } From c6c24792680613f7fdbd9cb3def9a7930d01d292 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 6 Apr 2026 15:22:20 +0700 Subject: [PATCH 25/50] Fix newbot links parsing. --- Telegram/SourceFiles/core/local_url_handlers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 6626de2f3e..c7309d93ca 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -1912,7 +1912,7 @@ QString TryConvertUrlToLocal(QString url) { } else if (const auto callMatch = regex_match(u"^call/([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"_q, query, matchOptions)) { const auto slug = callMatch->captured(1); return u"tg://call?slug="_q + slug; - } else if (const auto newbotMatch = regex_match(u"^newbot/([a-zA-Z0-9\\.\\_]+)(/([a-zA-Z0-9\\.\\_]+))?(\\?(.+))?$"_q, query, matchOptions)) { + } else if (const auto newbotMatch = regex_match(u"^newbot/([a-zA-Z0-9\\.\\_]+)(/([a-zA-Z0-9\\.\\_]+))?(/?\\?(.+))?$"_q, query, matchOptions)) { const auto manager = newbotMatch->captured(1); const auto username = newbotMatch->captured(3); const auto params = newbotMatch->captured(5); From b51c0ca5e77ddf7b65b50746365d8786bf82d4f4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 6 Apr 2026 15:34:37 +0700 Subject: [PATCH 26/50] Allow trailing slash in newbot link. --- Telegram/SourceFiles/core/local_url_handlers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index c7309d93ca..3abb775ec4 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -1912,7 +1912,7 @@ QString TryConvertUrlToLocal(QString url) { } else if (const auto callMatch = regex_match(u"^call/([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"_q, query, matchOptions)) { const auto slug = callMatch->captured(1); return u"tg://call?slug="_q + slug; - } else if (const auto newbotMatch = regex_match(u"^newbot/([a-zA-Z0-9\\.\\_]+)(/([a-zA-Z0-9\\.\\_]+))?(/?\\?(.+))?$"_q, query, matchOptions)) { + } else if (const auto newbotMatch = regex_match(u"^newbot/([a-zA-Z0-9\\.\\_]+)(/([a-zA-Z0-9\\.\\_]*))?(/?\\?(.+))?$"_q, query, matchOptions)) { const auto manager = newbotMatch->captured(1); const auto username = newbotMatch->captured(3); const auto params = newbotMatch->captured(5); From 00bd28278de1b4e21c4fac132866a95ef8d67c07 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 6 Apr 2026 15:18:16 +0700 Subject: [PATCH 27/50] Show unofficial app warning. --- Telegram/Resources/langs/lang.strings | 1 + Telegram/SourceFiles/data/data_user.cpp | 6 +- Telegram/SourceFiles/data/data_user.h | 6 +- Telegram/SourceFiles/info/info.style | 3 + .../profile/info_profile_inner_widget.cpp | 68 +++++++++++++++++++ 5 files changed, 82 insertions(+), 2 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 2eca1fc8e9..e92802de88 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1603,6 +1603,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_profile_saved_messages#other" = "{count} saved messages"; "lng_profile_peer_gifts#one" = "{count} gift"; "lng_profile_peer_gifts#other" = "{count} gifts"; +"lng_profile_unofficial_warning" = "{icon} {name} uses an unofficial Telegram client — messages to this user may be less secure."; "lng_profile_participants_section" = "Members"; "lng_profile_subscribers_section" = "Subscribers"; "lng_profile_add_contact" = "Add Contact"; diff --git a/Telegram/SourceFiles/data/data_user.cpp b/Telegram/SourceFiles/data/data_user.cpp index be07c2d980..2a5c93abdb 100644 --- a/Telegram/SourceFiles/data/data_user.cpp +++ b/Telegram/SourceFiles/data/data_user.cpp @@ -892,7 +892,8 @@ void ApplyUserUpdate(not_null user, const MTPDuserFull &update) { : Flag()) | (user->starsPerMessage() ? Flag::HasStarsPerMessage : Flag()) | Flag::MessageMoneyRestrictionsKnown - | Flag::RequiresPremiumToWrite; + | Flag::RequiresPremiumToWrite + | Flag::UnofficialSecurityRisk; user->setFlags((user->flags() & ~mask) | (update.is_phone_calls_private() ? Flag::PhoneCallsPrivate @@ -908,6 +909,9 @@ void ApplyUserUpdate(not_null user, const MTPDuserFull &update) { | Flag::MessageMoneyRestrictionsKnown | (update.is_contact_require_premium() ? (Flag::RequiresPremiumToWrite | Flag::HasRequirePremiumToWrite) + : Flag()) + | (update.is_unofficial_security_risk() + ? Flag::UnofficialSecurityRisk : Flag())); user->setIsBlocked(update.is_blocked()); user->setCallsStatus(update.is_phone_calls_private() diff --git a/Telegram/SourceFiles/data/data_user.h b/Telegram/SourceFiles/data/data_user.h index 4f4d097065..e1894fcd26 100644 --- a/Telegram/SourceFiles/data/data_user.h +++ b/Telegram/SourceFiles/data/data_user.h @@ -130,7 +130,7 @@ enum class UserDataFlag : uint32 { DiscardMinPhoto = (1 << 12), Self = (1 << 13), Premium = (1 << 14), - //CanReceiveGifts = (1 << 15), + UnofficialSecurityRisk = (1 << 15), VoiceMessagesForbidden = (1 << 16), PersonalPhoto = (1 << 17), StoriesHidden = (1 << 18), @@ -303,6 +303,10 @@ public: [[nodiscard]] UserId botManagerId() const; void setBotManagerId(UserId managerId); + [[nodiscard]] bool unofficialSecurityRisk() const { + return flags() & Flag::UnofficialSecurityRisk; + } + [[nodiscard]] MTPInputUser inputUser() const; QString firstName; diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index 837637739c..f3d0b09f01 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -1463,3 +1463,6 @@ infoMusicButtonRipple: universalRippleAnimation; infoMusicButtonPadding: margins(16px, 6px, 13px, 6px); memberTagPillPadding: margins(5px, -1px, 5px, 0px); + +infoSecurityRiskIconSize: 16px; +infoSecurityRiskIconMargin: margins(0px, 2px, 0px, 0px); diff --git a/Telegram/SourceFiles/info/profile/info_profile_inner_widget.cpp b/Telegram/SourceFiles/info/profile/info_profile_inner_widget.cpp index 6929a246e9..f0ed4a46dd 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_inner_widget.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_inner_widget.cpp @@ -33,14 +33,17 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "apiwrap.h" #include "api/api_peer_photo.h" #include "lang/lang_keys.h" +#include "ui/text/custom_emoji_helper.h" #include "ui/text/format_song_document_name.h" #include "ui/widgets/buttons.h" #include "ui/widgets/checkbox.h" +#include "ui/widgets/labels.h" #include "ui/widgets/scroll_area.h" #include "ui/widgets/shadow.h" #include "ui/wrap/fade_wrap.h" #include "ui/wrap/vertical_layout.h" #include "ui/wrap/slide_wrap.h" +#include "ui/painter.h" #include "ui/vertical_list.h" #include "ui/ui_utility.h" #include "styles/style_info.h" @@ -79,6 +82,68 @@ void AddAboutVerification( }, inner->lifetime()); } +void AddUnofficialSecurityRiskWarning( + not_null container, + not_null user) { + const auto content = container->add( + object_ptr(container)); + user->session().changes().peerFlagsValue( + user, + Data::PeerUpdate::Flag::FullInfo + ) | rpl::on_next([=] { + while (content->count()) { + delete content->widgetAt(0); + } + if (user->unofficialSecurityRisk()) { + auto helper = Ui::Text::CustomEmojiHelper(); + auto icon = helper.paletteDependent({ + .factory = [] { + const auto s = st::infoSecurityRiskIconSize; + const auto ratio = style::DevicePixelRatio(); + const auto rect = QRect(0, 0, s, s); + auto result = QImage( + rect.size() * ratio, + QImage::Format_ARGB32_Premultiplied); + result.setDevicePixelRatio(ratio); + result.fill(Qt::transparent); + + auto p = QPainter(&result); + auto hq = PainterHighQualityEnabler(p); + p.setPen(Qt::NoPen); + p.setBrush(st::attentionButtonFg); + p.drawEllipse(rect); + + p.setPen(st::windowFgActive); + p.setFont(st::semiboldFont); + p.drawText(rect, u"!"_q, style::al_center); + + p.end(); + return result; + }, + .margin = st::infoSecurityRiskIconMargin, + }); + auto label = object_ptr( + content, + tr::lng_profile_unofficial_warning( + lt_icon, + rpl::single(std::move(icon)), + lt_name, + rpl::single(TextWithEntities{ user->firstName }), + tr::marked), + st::defaultDividerLabel.label, + st::defaultPopupMenu, + helper.context([=] { content->update(); })); + content->add(object_ptr( + content, + std::move(label), + st::defaultBoxDividerLabelPadding, + st::defaultDividerLabel.bar, + RectPart::Top | RectPart::Bottom)); + } + content->resizeToWidth(content->width()); + }, content->lifetime()); +} + } // namespace InnerWidget::InnerWidget( @@ -125,6 +190,9 @@ object_ptr InnerWidget::setupContent( auto result = object_ptr(parent); setupSavedMusic(result); + if (const auto user = _peer->asUser()) { + AddUnofficialSecurityRiskWarning(result.data(), user); + } if (_topic && _topic->creating()) { return result; } From 783ed506bd0e28df4200a26a0da32861a2b83306 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 08:56:43 +0300 Subject: [PATCH 28/50] Added ability to jump between markers with Alt+Arrows in media view. --- .../media/view/media_view_overlay_widget.cpp | 32 +++++++++++++++++++ .../media/view/media_view_playback_controls.h | 3 ++ 2 files changed, 35 insertions(+) diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 034aeaa31f..542ceb9da7 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -6261,6 +6261,38 @@ void OverlayWidget::handleKeyPress(not_null e) { } else if (key == Qt::Key_Space) { playbackPauseResume(); return; + } else if (modifiers.testFlag(Qt::AltModifier) + && (key == Qt::Key_Left || key == Qt::Key_Right) + && _streamed->controls + && !_streamed->controls->timestamps().empty()) { + const auto ×tamps = _streamed->controls->timestamps(); + const auto &state = _streamed->instance.info().video.state; + const auto duration = state.duration; + if (duration > 0) { + const auto progress = state.position + / float64(duration); + const auto eps = 0.005; + if (key == Qt::Key_Right) { + for (const auto &ts : timestamps) { + if (ts.position > progress + eps) { + activateControls(); + restartAtProgress(ts.position); + return; + } + } + } else { + for (auto i = int(timestamps.size()) - 1; i >= 0; --i) { + if (timestamps[i].position < progress - eps) { + activateControls(); + restartAtProgress(timestamps[i].position); + return; + } + } + activateControls(); + restartAtSeekPosition(0); + } + } + return; } else if (_fullScreenVideo) { if (key == Qt::Key_Escape) { playbackToggleFullScreen(); diff --git a/Telegram/SourceFiles/media/view/media_view_playback_controls.h b/Telegram/SourceFiles/media/view/media_view_playback_controls.h index 91c5272c3b..fb68c6d758 100644 --- a/Telegram/SourceFiles/media/view/media_view_playback_controls.h +++ b/Telegram/SourceFiles/media/view/media_view_playback_controls.h @@ -72,6 +72,9 @@ public: void setTimestamps(std::vector timestamps); void setInFullScreen(bool inFullScreen); [[nodiscard]] bool hasTimestamps() const; + [[nodiscard]] auto ×tamps() const { + return _timestamps; + } [[nodiscard]] bool hasMenu() const; [[nodiscard]] bool dragging() const; From 4191ecc2e6bdd4fc6b18ee82c4111d2819921676 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 09:10:10 +0300 Subject: [PATCH 29/50] Added simple animation while jumping between markers in media view. --- .../SourceFiles/media/view/media_view.style | 13 ++ .../media/view/media_view_overlay_opengl.cpp | 10 +- .../media/view/media_view_overlay_opengl.h | 2 + .../media/view/media_view_overlay_raster.cpp | 6 + .../media/view/media_view_overlay_raster.h | 1 + .../media/view/media_view_overlay_renderer.h | 1 + .../media/view/media_view_overlay_widget.cpp | 190 ++++++++++++++++-- .../media/view/media_view_overlay_widget.h | 15 ++ .../view/media_view_playback_controls.cpp | 25 +++ .../media/view/media_view_playback_controls.h | 7 +- 10 files changed, 249 insertions(+), 21 deletions(-) diff --git a/Telegram/SourceFiles/media/view/media_view.style b/Telegram/SourceFiles/media/view/media_view.style index 516186ae19..b8fcb37e13 100644 --- a/Telegram/SourceFiles/media/view/media_view.style +++ b/Telegram/SourceFiles/media/view/media_view.style @@ -223,6 +223,19 @@ mediaviewSaveMsgHiding: 2500; mediaviewSaveMsgStyle: TextStyle(defaultTextStyle) { font: font(16px); } +mediaviewChapterPadding: margins(20px, 12px, 20px, 12px); +mediaviewChapterFont: font(15px semibold); +mediaviewChapterShowing: 200; +mediaviewChapterShown: 1500; +mediaviewChapterHiding: 400; +mediaviewChapterArrowSize: 10px; +mediaviewChapterArrowWidth: 6px; +mediaviewChapterArrowShift: 16px; +mediaviewChapterArrowGap: 12px; +mediaviewChapterArrowSlide: 350; +mediaviewChapterArrowPause: 1500; +mediaviewChapterArrowFade: 300; + mediaviewTextPalette: TextPalette(defaultTextPalette) { linkFg: mediaviewTextLinkFg; monoFg: mediaviewCaptionFg; diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_opengl.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_opengl.cpp index cacf4d7de0..8092b29078 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_opengl.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_opengl.cpp @@ -28,7 +28,8 @@ constexpr auto kRadialLoadingOffset = kNotchOffset + 4; constexpr auto kThemePreviewOffset = kRadialLoadingOffset + 4; constexpr auto kDocumentBubbleOffset = kThemePreviewOffset + 4; constexpr auto kSaveMsgOffset = kDocumentBubbleOffset + 4; -constexpr auto kFooterOffset = kSaveMsgOffset + 4; +constexpr auto kChapterOffset = kSaveMsgOffset + 4; +constexpr auto kFooterOffset = kChapterOffset + 4; constexpr auto kCaptionOffset = kFooterOffset + 4; constexpr auto kGroupThumbsOffset = kCaptionOffset + 4; constexpr auto kControlsOffset = kGroupThumbsOffset + 4; @@ -724,6 +725,13 @@ void OverlayWidget::RendererGL::paintSaveMsg(QRect outer) { }, kSaveMsgOffset, true); } +void OverlayWidget::RendererGL::paintChapter(QRect outer) { + paintUsingRaster(_chapterImage, outer, [&](Painter &&p) { + const auto newOuter = QRect(QPoint(), outer.size()); + _owner->paintChapterContent(p, newOuter, newOuter); + }, kChapterOffset, true); +} + void OverlayWidget::RendererGL::paintControlsStart() { validateControls(); _f->glActiveTexture(GL_TEXTURE0); diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_opengl.h b/Telegram/SourceFiles/media/view/media_view_overlay_opengl.h index 8438bc9dc5..f0f36592c4 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_opengl.h +++ b/Telegram/SourceFiles/media/view/media_view_overlay_opengl.h @@ -59,6 +59,7 @@ private: void paintThemePreview(QRect outer) override; void paintDocumentBubble(QRect outer, QRect icon) override; void paintSaveMsg(QRect outer) override; + void paintChapter(QRect outer) override; void paintControlsStart() override; void paintControl( Over control, @@ -144,6 +145,7 @@ private: Ui::GL::Image _documentBubbleImage; Ui::GL::Image _themePreviewImage; Ui::GL::Image _saveMsgImage; + Ui::GL::Image _chapterImage; Ui::GL::Image _footerImage; Ui::GL::Image _captionImage; Ui::GL::Image _groupThumbsImage; diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_raster.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_raster.cpp index d45becf852..2bb415e7eb 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_raster.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_raster.cpp @@ -275,6 +275,12 @@ void OverlayWidget::RendererSW::paintSaveMsg(QRect outer) { } } +void OverlayWidget::RendererSW::paintChapter(QRect outer) { + if (outer.intersects(_clipOuter)) { + _owner->paintChapterContent(*_p, outer, _clipOuter); + } +} + void OverlayWidget::RendererSW::paintControlsStart() { } diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_raster.h b/Telegram/SourceFiles/media/view/media_view_overlay_raster.h index f8b2d89f1d..2d20aab9e2 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_raster.h +++ b/Telegram/SourceFiles/media/view/media_view_overlay_raster.h @@ -43,6 +43,7 @@ private: void paintThemePreview(QRect outer) override; void paintDocumentBubble(QRect outer, QRect icon) override; void paintSaveMsg(QRect outer) override; + void paintChapter(QRect outer) override; void paintControlsStart() override; void paintControl( Over control, diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_renderer.h b/Telegram/SourceFiles/media/view/media_view_overlay_renderer.h index 1ed82dde9d..98296a5b12 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_renderer.h +++ b/Telegram/SourceFiles/media/view/media_view_overlay_renderer.h @@ -33,6 +33,7 @@ public: virtual void paintThemePreview(QRect outer) = 0; virtual void paintDocumentBubble(QRect outer, QRect icon) = 0; virtual void paintSaveMsg(QRect outer) = 0; + virtual void paintChapter(QRect outer) = 0; virtual void paintControlsStart() = 0; virtual void paintControl( Over control, diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 542ceb9da7..ddc4203931 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -603,6 +603,10 @@ OverlayWidget::OverlayWidget() _saveMsgAnimation.start([=] { updateSaveMsg(); }, 1., 0., delay); }); + _chapterTimer.setCallback([=, delay = st::mediaviewChapterHiding] { + _chapterAnimation.start([=] { updateChapter(); }, 1., 0., delay); + }); + _docRectImage = QImage( st::mediaviewFileSize * style::DevicePixelRatio(), QImage::Format_ARGB32_Premultiplied); @@ -5722,6 +5726,9 @@ void OverlayWidget::paint(not_null renderer) { if (isSaveMsgShown()) { renderer->paintSaveMsg(_saveMsg); } + if (isChapterShown()) { + renderer->paintChapter(_chapterRect); + } const auto opacity = _fullScreenVideo ? 0. : _controlsOpacity.current(); if (opacity > 0) { @@ -5982,6 +5989,154 @@ void OverlayWidget::paintSaveMsgContent( p.setOpacity(1); } +void OverlayWidget::showChapterIndicator( + const QString &name, + int direction) { + if (name.isEmpty()) { + return; + } + _chapterText = name; + + const auto font = st::mediaviewChapterFont; + const auto padding = st::mediaviewChapterPadding; + const auto arrowSpace = st::mediaviewChapterArrowWidth + + st::mediaviewChapterArrowGap; + const auto textWidth = font->width(_chapterText); + const auto w = padding.left() + + arrowSpace + + textWidth + + arrowSpace + + padding.right(); + const auto h = rect::m::sum::v(padding) + font->height; + _chapterRect = QRect( + (width() - w) / 2, + _minUsedTop + (_maxUsedHeight - h) / 2, + w, + h); + + if (isChapterShown()) { + _chapterTimer.callOnce(st::mediaviewChapterShown); + } else { + const auto callback = [=](float64 value) { + updateChapter(); + if (!_chapterAnimation.animating()) { + _chapterTimer.callOnce(st::mediaviewChapterShown); + } + }; + _chapterAnimation.start( + callback, + 0., + 1., + st::mediaviewChapterShowing); + } + + _chapterArrows.erase( + ranges::remove_if( + _chapterArrows, + [&](const auto &a) { + return !a->animation.animating() + || (a->direction != direction); + }), + _chapterArrows.end()); + auto arrow = std::make_unique(); + arrow->direction = direction; + arrow->animation.start( + [=] { updateChapter(); }, + 0., + 1., + st::mediaviewChapterArrowSlide + + st::mediaviewChapterArrowPause + + st::mediaviewChapterArrowFade); + _chapterArrows.push_back(std::move(arrow)); + updateChapter(); +} + +void OverlayWidget::paintChapterContent( + Painter &p, + QRect outer, + QRect clip) { + const auto opacity = _chapterAnimation.value(1.); + p.setOpacity(opacity); + Ui::FillRoundRect( + p, + outer, + st::mediaviewSaveMsgBg, + Ui::MediaviewSaveCorners); + + const auto font = st::mediaviewChapterFont; + const auto padding = st::mediaviewChapterPadding; + const auto arrowSize = st::mediaviewChapterArrowSize; + const auto arrowWidth = st::mediaviewChapterArrowWidth; + const auto arrowGap = st::mediaviewChapterArrowGap; + const auto textX = outer.x() + + padding.left() + + arrowWidth + + arrowGap; + const auto textY = outer.y() + padding.top(); + + p.setFont(font); + p.setPen(st::mediaviewSaveMsgFg); + p.drawText(textX, textY + font->ascent, _chapterText); + + const auto cy = outer.y() + outer.height() / 2.; + const auto halfH = arrowSize / 2.; + const auto totalDuration = float64(st::mediaviewChapterArrowSlide + + st::mediaviewChapterArrowPause + + st::mediaviewChapterArrowFade); + const auto slideEnd = st::mediaviewChapterArrowSlide / totalDuration; + const auto fadeStart = 1. - st::mediaviewChapterArrowFade / totalDuration; + auto hq = PainterHighQualityEnabler(p); + auto pen = QPen(st::mediaviewSaveMsgFg->c); + pen.setWidthF(st::lineWidth * 1.5); + pen.setCapStyle(Qt::RoundCap); + pen.setJoinStyle(Qt::RoundJoin); + p.setPen(pen); + p.setBrush(Qt::NoBrush); + for (const auto &arrow : _chapterArrows) { + if (!arrow->animation.animating()) { + continue; + } + const auto progress = arrow->animation.value(1.); + const auto slideProgress = std::min(progress / slideEnd, 1.); + const auto shift = st::mediaviewChapterArrowShift * slideProgress; + const auto arrowOpacity = (progress <= fadeStart) + ? slideProgress + : (1. - progress) / (1. - fadeStart); + p.setOpacity(opacity * arrowOpacity); + auto path = QPainterPath(); + if (arrow->direction > 0) { + const auto ax = outer.x() + + outer.width() + - padding.right() + - arrowGap + - arrowWidth + + shift; + path.moveTo(ax, cy - halfH); + path.lineTo(ax + arrowWidth, cy); + path.lineTo(ax, cy + halfH); + } else { + const auto ax = outer.x() + + padding.left() + + arrowGap + + arrowWidth + - shift; + path.moveTo(ax, cy - halfH); + path.lineTo(ax - arrowWidth, cy); + path.lineTo(ax, cy + halfH); + } + p.drawPath(path); + } + p.setOpacity(1); +} + +bool OverlayWidget::isChapterShown() const { + return _chapterAnimation.animating() || _chapterTimer.isActive(); +} + +void OverlayWidget::updateChapter() { + update(_chapterRect); +} + bool OverlayWidget::saveControlLocked() const { const auto story = _stories ? _stories->story() : nullptr; return story @@ -6264,32 +6419,28 @@ void OverlayWidget::handleKeyPress(not_null e) { } else if (modifiers.testFlag(Qt::AltModifier) && (key == Qt::Key_Left || key == Qt::Key_Right) && _streamed->controls - && !_streamed->controls->timestamps().empty()) { - const auto ×tamps = _streamed->controls->timestamps(); + && _streamed->controls->hasTimestamps()) { const auto &state = _streamed->instance.info().video.state; const auto duration = state.duration; if (duration > 0) { const auto progress = state.position / float64(duration); - const auto eps = 0.005; + const auto &controls = _streamed->controls; if (key == Qt::Key_Right) { - for (const auto &ts : timestamps) { - if (ts.position > progress + eps) { - activateControls(); - restartAtProgress(ts.position); - return; - } + if (const auto ts = controls->nextTimestamp(progress)) { + activateControls(); + restartAtProgress(ts->position); + showChapterIndicator(ts->label, 1); } } else { - for (auto i = int(timestamps.size()) - 1; i >= 0; --i) { - if (timestamps[i].position < progress - eps) { - activateControls(); - restartAtProgress(timestamps[i].position); - return; - } + if (const auto ts = controls->prevTimestamp(progress)) { + activateControls(); + restartAtProgress(ts->position); + showChapterIndicator(ts->label, -1); + } else { + activateControls(); + restartAtSeekPosition(0); } - activateControls(); - restartAtSeekPosition(0); } } return; @@ -7466,6 +7617,11 @@ void OverlayWidget::clearBeforeHide() { if (_menu) { _menu->hideMenu(true); } + _chapterText = QString(); + _chapterRect = QRect(); + _chapterAnimation.stop(); + _chapterTimer.cancel(); + _chapterArrows.clear(); _controlsHideTimer.cancel(); _controlsState = ControlsShown; _controlsOpacity = anim::value(1); diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.h b/Telegram/SourceFiles/media/view/media_view_overlay_widget.h index a2f2373103..39f301063e 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.h +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.h @@ -517,6 +517,11 @@ private: bool nonbright = false) const; [[nodiscard]] bool isSaveMsgShown() const; + void showChapterIndicator(const QString &name, int direction); + void paintChapterContent(Painter &p, QRect outer, QRect clip); + [[nodiscard]] bool isChapterShown() const; + void updateChapter(); + void updateOverRect(Over state); bool updateOverState(Over newState); float64 overLevel(Over control) const; @@ -774,6 +779,16 @@ private: Ui::Animations::Simple _saveMsgAnimation; base::Timer _saveMsgTimer; + QString _chapterText; + QRect _chapterRect; + Ui::Animations::Simple _chapterAnimation; + base::Timer _chapterTimer; + struct ChapterArrow { + Ui::Animations::Simple animation; + int direction = 0; + }; + std::vector> _chapterArrows; + base::flat_map _animations; base::flat_map _animationOpacities; diff --git a/Telegram/SourceFiles/media/view/media_view_playback_controls.cpp b/Telegram/SourceFiles/media/view/media_view_playback_controls.cpp index 08522a6ca5..e680d3a909 100644 --- a/Telegram/SourceFiles/media/view/media_view_playback_controls.cpp +++ b/Telegram/SourceFiles/media/view/media_view_playback_controls.cpp @@ -24,6 +24,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Media { namespace View { +namespace { + +constexpr auto kEps = 0.005; + +} // namespace PlaybackControls::PlaybackControls( QWidget *parent, @@ -303,6 +308,26 @@ bool PlaybackControls::hasTimestamps() const { return _timestampLabel != nullptr; } +auto PlaybackControls::nextTimestamp(float64 progress) const +-> std::optional { + for (const auto &ts : _timestamps) { + if (ts.position > progress + kEps) { + return ts; + } + } + return std::nullopt; +} + +auto PlaybackControls::prevTimestamp(float64 progress) const +-> std::optional { + for (auto i = int(_timestamps.size()) - 1; i >= 0; --i) { + if (_timestamps[i].position < progress - kEps) { + return _timestamps[i]; + } + } + return std::nullopt; +} + void PlaybackControls::updateTimestampLabel() { if (!_timestampLabel) { return; diff --git a/Telegram/SourceFiles/media/view/media_view_playback_controls.h b/Telegram/SourceFiles/media/view/media_view_playback_controls.h index fb68c6d758..881c109a4e 100644 --- a/Telegram/SourceFiles/media/view/media_view_playback_controls.h +++ b/Telegram/SourceFiles/media/view/media_view_playback_controls.h @@ -72,9 +72,10 @@ public: void setTimestamps(std::vector timestamps); void setInFullScreen(bool inFullScreen); [[nodiscard]] bool hasTimestamps() const; - [[nodiscard]] auto ×tamps() const { - return _timestamps; - } + [[nodiscard]] std::optional nextTimestamp( + float64 progress) const; + [[nodiscard]] std::optional prevTimestamp( + float64 progress) const; [[nodiscard]] bool hasMenu() const; [[nodiscard]] bool dragging() const; From 8346a90d65b1716a7fc5fee7507b78359b1f2c79 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 09:39:50 +0300 Subject: [PATCH 30/50] Fixed summarize button small clipping during loading animation. --- .../history/view/history_view_transcribe_button.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/view/history_view_transcribe_button.cpp b/Telegram/SourceFiles/history/view/history_view_transcribe_button.cpp index 3dc87cb155..3c8243281f 100644 --- a/Telegram/SourceFiles/history/view/history_view_transcribe_button.cpp +++ b/Telegram/SourceFiles/history/view/history_view_transcribe_button.cpp @@ -84,7 +84,8 @@ void TranscribeButton::setLoading(bool loading) { item, _lastPaintedPoint.isNull() ? QRect() - : QRect(_lastPaintedPoint, size())); + : (QRect(_lastPaintedPoint, size())) + + Margins(st::lineWidth)); } }, st::historyTranscribeRadialAnimation); From 8decb55e5192fca6e7f5ac268aaa5e8ef8cb5595 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 10:35:54 +0300 Subject: [PATCH 31/50] Fixed file reference refresh for user personal and fallback photos. --- Telegram/SourceFiles/data/data_file_origin.cpp | 6 +++++- .../media/view/media_view_overlay_widget.cpp | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/data/data_file_origin.cpp b/Telegram/SourceFiles/data/data_file_origin.cpp index ffeb2f719e..9e24dffd1f 100644 --- a/Telegram/SourceFiles/data/data_file_origin.cpp +++ b/Telegram/SourceFiles/data/data_file_origin.cpp @@ -174,7 +174,11 @@ struct FileReferenceAccumulator { }); } void push(const MTPusers_UserFull &data) { - push(data.data().vfull_user().data().vpersonal_photo()); + const auto &full = data.data().vfull_user().data(); + push(full.vpersonal_photo()); + push(full.vfallback_photo()); + push(full.vprofile_photo()); + } } void push(const MTPmessages_RecentStickers &data) { data.match([&](const MTPDmessages_recentStickers &data) { diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index ddc4203931..bace1de7de 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -3526,6 +3526,12 @@ Data::FileOrigin OverlayWidget::fileOrigin() const { } else if (_message) { return _message->fullId(); } else if (_photo && _user) { + const auto dominated = (_user->hasPersonalPhoto() + && _photo->id == _user->userpicPhotoId()) + || SyncUserFallbackPhotoViewer(_user) == _photo->id; + if (dominated) { + return Data::FileOriginFullUser(peerToUser(_user->id)); + } return Data::FileOriginUserPhoto(peerToUser(_user->id), _photo->id); } else if (_photo && _peer && _peer->userpicPhotoId() == _photo->id) { return Data::FileOriginPeerPhoto(_peer->id); @@ -3541,6 +3547,12 @@ Data::FileOrigin OverlayWidget::fileOrigin(const Entity &entity) const { } const auto photo = v::get>(entity.data); if (_user) { + const auto dominated = (_user->hasPersonalPhoto() + && photo->id == _user->userpicPhotoId()) + || SyncUserFallbackPhotoViewer(_user) == photo->id; + if (dominated) { + return Data::FileOriginFullUser(peerToUser(_user->id)); + } return Data::FileOriginUserPhoto(peerToUser(_user->id), photo->id); } else if (_peer && _peer->userpicPhotoId() == photo->id) { return Data::FileOriginPeerPhoto(_peer->id); From ec94dc26ac693c4dcb1501692a9825f08e2181d6 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 11:40:41 +0300 Subject: [PATCH 32/50] Fixed file reference refresh for group and channel photos. --- Telegram/SourceFiles/apiwrap.cpp | 10 +++++++++- Telegram/SourceFiles/data/data_file_origin.cpp | 13 +++++++++++++ Telegram/SourceFiles/data/data_file_origin.h | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index ccc2891b19..03c9e7ec49 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -2584,7 +2584,15 @@ void ApiWrap::refreshFileReference( fail(); } }, [&](Data::FileOriginPeerPhoto data) { - fail(); + const auto peer = _session->data().peer(data.peerId); + if (const auto channel = peer->asChannel()) { + request(MTPchannels_GetFullChannel( + channel->inputChannel())); + } else if (const auto chat = peer->asChat()) { + request(MTPmessages_GetFullChat(chat->inputChat())); + } else { + fail(); + } }, [&](Data::FileOriginStickerSet data) { const auto isRecentAttached = (data.setId == Data::Stickers::CloudRecentAttachedSetId); diff --git a/Telegram/SourceFiles/data/data_file_origin.cpp b/Telegram/SourceFiles/data/data_file_origin.cpp index 9e24dffd1f..9a832c36f3 100644 --- a/Telegram/SourceFiles/data/data_file_origin.cpp +++ b/Telegram/SourceFiles/data/data_file_origin.cpp @@ -179,6 +179,15 @@ struct FileReferenceAccumulator { push(full.vfallback_photo()); push(full.vprofile_photo()); } + void push(const MTPChatFull &data) { + data.match([&](const MTPDchatFull &data) { + push(data.vchat_photo()); + }, [&](const MTPDchannelFull &data) { + push(data.vchat_photo()); + }); + } + void push(const MTPmessages_ChatFull &data) { + push(data.data().vfull_chat()); } void push(const MTPmessages_RecentStickers &data) { data.match([&](const MTPDmessages_recentStickers &data) { @@ -250,6 +259,10 @@ UpdatedFileReferences GetFileReferences(const MTPusers_UserFull &data) { return GetFileReferencesHelper(data); } +UpdatedFileReferences GetFileReferences(const MTPmessages_ChatFull &data) { + return GetFileReferencesHelper(data); +} + UpdatedFileReferences GetFileReferences( const MTPmessages_RecentStickers &data) { return GetFileReferencesHelper(data); diff --git a/Telegram/SourceFiles/data/data_file_origin.h b/Telegram/SourceFiles/data/data_file_origin.h index 283a0fe034..47ce47a990 100644 --- a/Telegram/SourceFiles/data/data_file_origin.h +++ b/Telegram/SourceFiles/data/data_file_origin.h @@ -208,6 +208,7 @@ struct UpdatedFileReferences { UpdatedFileReferences GetFileReferences(const MTPmessages_Messages &data); UpdatedFileReferences GetFileReferences(const MTPphotos_Photos &data); UpdatedFileReferences GetFileReferences(const MTPusers_UserFull &data); +UpdatedFileReferences GetFileReferences(const MTPmessages_ChatFull &data); UpdatedFileReferences GetFileReferences( const MTPmessages_RecentStickers &data); UpdatedFileReferences GetFileReferences( From 6f4ed6883bcdb01becc23d3b1cadde47566f2acd Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 11:31:08 +0300 Subject: [PATCH 33/50] Fixed userpic photo origin to use full user for refresh. --- Telegram/SourceFiles/data/data_peer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/data/data_peer.cpp b/Telegram/SourceFiles/data/data_peer.cpp index 96cceb4d49..2669111e09 100644 --- a/Telegram/SourceFiles/data/data_peer.cpp +++ b/Telegram/SourceFiles/data/data_peer.cpp @@ -584,7 +584,7 @@ Data::FileOrigin PeerData::userpicOrigin() const { Data::FileOrigin PeerData::userpicPhotoOrigin() const { return (isUser() && userpicPhotoId()) - ? Data::FileOriginUserPhoto(peerToUser(id).bare, userpicPhotoId()) + ? Data::FileOriginFullUser(peerToUser(id)) : Data::FileOrigin(); } From 3af2bf61fe5da4c70d61fca9bfb6bbbfdec5a992 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 12:24:28 +0300 Subject: [PATCH 34/50] Fixed tooltip crash when top peers selector widget has small width. --- .../history/view/history_view_top_peers_selector.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_top_peers_selector.cpp b/Telegram/SourceFiles/history/view/history_view_top_peers_selector.cpp index 50644eea78..63da74acd6 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_peers_selector.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_peers_selector.cpp @@ -90,10 +90,11 @@ void ShowTopPeersSelector( const auto contentHeight = int( st::topPeersSelectorUserpicSize * (1. + st::topPeersSelectorUserpicExpand)); - const auto selectorWidth = contentWidth - + 2 * st::topPeersSelectorPadding; const auto selectorHeight = contentHeight + 2 * st::topPeersSelectorPadding; + const auto selectorWidth = (peers.size() == 1) + ? selectorHeight + : (contentWidth + 2 * st::topPeersSelectorPadding); struct State { base::unique_qptr selector; @@ -159,7 +160,10 @@ void ShowTopPeersSelector( peers[info.index]->isSelf() ? tr::lng_saved_messages(tr::rich) : NameValue(peers[info.index]) | rpl::map(tr::rich), - userpicsWidget->width(), + std::max( + userpicsWidget->width(), + st::topPeersSelectorImportantTooltipLabel.minWidth + + st::lineWidth), st::topPeersSelectorImportantTooltipLabel), st::topPeersSelectorImportantTooltip.padding), st::topPeersSelectorImportantTooltip); From c031f0988613a05d2940b353dc7f25c20cc8686d Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 12:46:19 +0300 Subject: [PATCH 35/50] Fixed display of button in connection box on non-default scales. --- Telegram/SourceFiles/boxes/boxes.style | 1 - Telegram/SourceFiles/boxes/connection_box.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/boxes.style b/Telegram/SourceFiles/boxes/boxes.style index a0aa71757a..e3830b53d1 100644 --- a/Telegram/SourceFiles/boxes/boxes.style +++ b/Telegram/SourceFiles/boxes/boxes.style @@ -695,7 +695,6 @@ proxyApplyBoxSponsorMargin: margins(13px, 8px, 13px, 8px); proxyApplyBoxButton: RoundButton(defaultActiveButton) { height: 38px; textTop: 10px; - radius: 19px; style: semiboldTextStyle; } proxyApplyBox: Box(defaultBox) { diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index 2d3e5395ce..e5d4d9ce5d 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -1672,6 +1672,7 @@ void ProxiesBoxController::ShowApplyConfirmation( Local::writeSettings(); box->closeBox(); }); + enableButton->setFullRadius(true); box->events() | rpl::on_next([=](not_null e) { if ((e->type() != QEvent::KeyPress) || !enableButton) { return; From 59b089a0cc438eadaf78408637c90f8c5673373d Mon Sep 17 00:00:00 2001 From: KevinHuge <151610589+KevinHuge@users.noreply.github.com> Date: Mon, 6 Apr 2026 17:23:50 +0800 Subject: [PATCH 36/50] Fix stale macOS tray icon colors after appearance switches Summary: Fix the macOS tray icon refresh path so the menu bar icon updates immediately after system light/dark appearance changes, even while Telegram stays unfocused in the background. Changes: The tray icon code was observing status button appearance changes but rendering against NSApp effectiveAppearance on macOS 10.14 and newer. Those two appearance sources do not update in lockstep while Telegram is unfocused, which caused the tray icon to redraw with a stale color until the app was focused. This change makes the renderer use status.button.effectiveAppearance directly so the icon color is derived from the same Cocoa object that emits the refresh signal. --- Telegram/SourceFiles/platform/mac/tray_mac.mm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/platform/mac/tray_mac.mm b/Telegram/SourceFiles/platform/mac/tray_mac.mm index 26751a2c40..6f2d565826 100644 --- a/Telegram/SourceFiles/platform/mac/tray_mac.mm +++ b/Telegram/SourceFiles/platform/mac/tray_mac.mm @@ -174,12 +174,7 @@ void UpdateIcon(const NSStatusItem *status) { return; } - const auto appearance = [&] { - if (@available(macOS 10.14, *)) { - return [NSApp effectiveAppearance]; - } - return status.button.effectiveAppearance; - }(); + const auto appearance = status.button.effectiveAppearance; const auto darkMode = [[appearance.name lowercaseString] containsString:@"dark"]; From d164a496750a4a8dca5140178cddf4d8fb7bbd9a Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 13:14:22 +0300 Subject: [PATCH 37/50] Removed premium section on first rate-limited summary click. Fixed #30201. --- Telegram/SourceFiles/api/api_transcribes.cpp | 12 +----------- Telegram/SourceFiles/api/api_transcribes.h | 5 +---- .../history/view/history_view_summary_header.cpp | 2 +- .../history/view/history_view_transcribe_button.cpp | 12 ++---------- 4 files changed, 5 insertions(+), 26 deletions(-) diff --git a/Telegram/SourceFiles/api/api_transcribes.cpp b/Telegram/SourceFiles/api/api_transcribes.cpp index bc31e1b998..7c6b271ca5 100644 --- a/Telegram/SourceFiles/api/api_transcribes.cpp +++ b/Telegram/SourceFiles/api/api_transcribes.cpp @@ -116,19 +116,14 @@ void Transcribes::toggle(not_null item) { } } -void Transcribes::toggleSummary( - not_null item, - Fn onPremiumRequired) { +void Transcribes::toggleSummary(not_null item) { const auto id = item->fullId(); auto i = _summaries.find(id); if (i == _summaries.end()) { - auto &entry = _summaries.emplace(id).first->second; - entry.onPremiumRequired = std::move(onPremiumRequired); summarize(item); } else if (!i->second.loading) { auto &entry = i->second; if (entry.result.empty()) { - entry.onPremiumRequired = std::move(onPremiumRequired); summarize(item); } else { entry.shown = entry.premiumRequired ? false : !entry.shown; @@ -265,7 +260,6 @@ void Transcribes::summarize(not_null item) { entry.requestId = 0; entry.loading = false; entry.premiumRequired = false; - entry.onPremiumRequired = nullptr; entry.languageId = translatedTo; entry.result = TextWithEntities( qs(data.vtext()), @@ -277,15 +271,11 @@ void Transcribes::summarize(not_null item) { }).fail([=](const MTP::Error &error) { auto &entry = _summaries[id]; if (error.type() == u"SUMMARY_FLOOD_PREMIUM"_q) { - if (!entry.premiumRequired && entry.onPremiumRequired) { - entry.onPremiumRequired(); - } entry.premiumRequired = true; } entry.requestId = 0; entry.shown = false; entry.loading = false; - entry.onPremiumRequired = nullptr; if (const auto item = _session->data().message(id)) { _session->data().requestItemTextRefresh(item); } diff --git a/Telegram/SourceFiles/api/api_transcribes.h b/Telegram/SourceFiles/api/api_transcribes.h index eb248e7cc5..7eef8a4fb6 100644 --- a/Telegram/SourceFiles/api/api_transcribes.h +++ b/Telegram/SourceFiles/api/api_transcribes.h @@ -19,7 +19,6 @@ class Session; namespace Api { struct SummaryEntry { - Fn onPremiumRequired = nullptr; TextWithEntities result; LanguageId languageId; bool shown = false; @@ -45,9 +44,7 @@ public: void toggle(not_null item); [[nodiscard]] const Entry &entry(not_null item) const; - void toggleSummary( - not_null item, - Fn onPremiumRequired); + void toggleSummary(not_null item); [[nodiscard]] const SummaryEntry &summary( not_null item) const; void checkSummaryToTranslate(FullMsgId id); diff --git a/Telegram/SourceFiles/history/view/history_view_summary_header.cpp b/Telegram/SourceFiles/history/view/history_view_summary_header.cpp index 1855bcd62b..70ee9ec07c 100644 --- a/Telegram/SourceFiles/history/view/history_view_summary_header.cpp +++ b/Telegram/SourceFiles/history/view/history_view_summary_header.cpp @@ -73,7 +73,7 @@ void SummaryHeader::update(not_null view) { } } if (const auto item = session->data().message(itemId)) { - session->api().transcribes().toggleSummary(item, nullptr); + session->api().transcribes().toggleSummary(item); } }); } diff --git a/Telegram/SourceFiles/history/view/history_view_transcribe_button.cpp b/Telegram/SourceFiles/history/view/history_view_transcribe_button.cpp index 3c8243281f..d414422435 100644 --- a/Telegram/SourceFiles/history/view/history_view_transcribe_button.cpp +++ b/Telegram/SourceFiles/history/view/history_view_transcribe_button.cpp @@ -381,7 +381,7 @@ ClickHandlerPtr TranscribeButton::link() { if (session->premium()) { auto &transcribes = session->api().transcribes(); return summarize - ? transcribes.toggleSummary(item, nullptr) + ? transcribes.toggleSummary(item) : transcribes.toggle(item); } const auto my = context.other.value(); @@ -410,15 +410,7 @@ ClickHandlerPtr TranscribeButton::link() { } } if (summarize) { - const auto weak = my.sessionWindow; - session->api().transcribes().toggleSummary(item, [=] { - if (const auto strong = weak.get()) { - Settings::ShowPremium(strong, u"summary"_q); - // ShowPremiumPreviewBox( - // strong, - // PremiumFeature::VoiceToText); - } - }); + session->api().transcribes().toggleSummary(item); } else { session->api().transcribes().toggle(item); } From 7c26a251cfcdb991ec2b2825c16fed9546bc96c0 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 16:07:28 +0300 Subject: [PATCH 38/50] Added text transform to RoundButton as mandatory argument. --- Telegram/SourceFiles/boxes/about_box.cpp | 5 ++--- .../SourceFiles/boxes/about_sponsored_box.cpp | 4 ++-- .../boxes/background_preview_box.cpp | 11 +++++------ .../SourceFiles/boxes/local_storage_box.cpp | 3 +-- .../boxes/peers/edit_peer_color_box.cpp | 7 ++++--- .../boxes/select_future_owner_box.cpp | 15 ++++++++------- .../boxes/star_gift_auction_box.cpp | 4 ++-- .../boxes/star_gift_preview_box.cpp | 7 +++++-- .../SourceFiles/boxes/url_auth_box_content.cpp | 14 ++++++++------ .../calls/group/calls_group_rtmp.cpp | 4 ++-- .../group/ui/desktop_capture_choose_source.cpp | 9 ++++++--- .../chat_helpers/ttl_media_layer_widget.cpp | 4 ++-- .../dialogs/dialogs_inner_widget.cpp | 5 ++--- .../ui/dialogs_top_bar_suggestion_content.cpp | 15 ++++++++------- .../dialogs/ui/posts_search_intro.cpp | 4 ++-- .../export/view/export_view_progress.cpp | 7 ++++--- .../export/view/export_view_settings.cpp | 8 ++++---- .../SourceFiles/history/history_widget.cpp | 5 ++--- .../controls/history_view_compose_controls.cpp | 4 ++-- .../view/history_view_contact_status.cpp | 5 ++--- .../history/view/history_view_pinned_bar.cpp | 4 ++-- .../view/history_view_scheduled_section.cpp | 4 ++-- .../view/history_view_sticker_toast.cpp | 4 ++-- .../view/history_view_top_bar_widget.cpp | 8 ++++---- .../view/history_view_translate_bar.cpp | 4 ++-- .../starref/info_bot_starref_setup_widget.cpp | 3 ++- .../boosts/create_giveaway_box.cpp | 4 ++-- .../boosts/info_boosts_inner_widget.cpp | 8 ++++---- .../earn/info_channel_earn_list.cpp | 14 ++++++++------ .../info/peer_gifts/info_peer_gifts_widget.cpp | 9 ++++----- .../info/polls/info_polls_list_widget.cpp | 5 ++--- .../info/profile/info_profile_actions.cpp | 14 ++++++++------ .../info/profile/info_profile_top_bar.cpp | 9 ++++----- .../info_similar_peers_widget.cpp | 1 + .../info/stories/info_stories_inner_widget.cpp | 5 ++--- .../info/stories/info_stories_widget.cpp | 4 ++-- .../userpic/info_userpic_emoji_builder.cpp | 4 ++-- .../inline_bots/inline_results_inner.cpp | 3 +-- Telegram/SourceFiles/intro/intro_widget.cpp | 15 ++++++++------- Telegram/SourceFiles/iv/iv_controller.cpp | 4 ++-- .../media/stories/media_stories_controller.cpp | 4 ++-- .../media/stories/media_stories_stealth.cpp | 3 ++- .../media/view/media_view_overlay_widget.cpp | 18 ++++++++---------- .../view/media_view_playback_sponsored.cpp | 4 ++-- Telegram/SourceFiles/menu/menu_sponsored.cpp | 3 ++- .../passport/passport_panel_edit_contact.cpp | 8 ++++---- .../passport/passport_panel_edit_document.cpp | 9 ++++++--- .../passport/passport_panel_edit_scans.cpp | 3 ++- .../passport/passport_panel_form.cpp | 3 ++- .../passport/passport_panel_password.cpp | 15 +++++++-------- .../payments/ui/payments_edit_card.cpp | 6 ++++-- .../payments/ui/payments_edit_information.cpp | 6 ++++-- .../payments/ui/payments_form_summary.cpp | 12 ++++++------ .../settings_cloud_password_common.cpp | 4 ++-- .../settings/sections/settings_credits.cpp | 7 ++++--- .../settings/sections/settings_folders.cpp | 7 +++---- .../sections/settings_local_passcode.cpp | 4 ++-- .../settings/sections/settings_main.cpp | 16 ++++++++-------- .../settings/sections/settings_passkeys.cpp | 4 ++-- .../settings/sections/settings_premium.cpp | 4 +++- .../settings/sections/settings_premium.h | 5 +++++ .../settings/settings_credits_graphics.cpp | 8 ++++---- .../SourceFiles/statistics/chart_widget.cpp | 10 ++++------ .../ui/boxes/collectible_info_box.cpp | 8 ++++---- .../SourceFiles/ui/boxes/confirm_phone_box.cpp | 5 ++--- .../SourceFiles/ui/boxes/emoji_stake_box.cpp | 3 ++- .../ui/boxes/show_or_premium_box.cpp | 4 ++-- .../ui/chat/choose_theme_controller.cpp | 8 ++++---- .../SourceFiles/ui/chat/group_call_bar.cpp | 7 ++++--- .../ui/controls/filter_link_header.cpp | 2 +- .../ui/controls/invite_link_buttons.cpp | 16 ++++++++-------- .../ui/controls/location_picker.cpp | 4 ++-- .../SourceFiles/ui/controls/table_rows.cpp | 4 ++-- .../window/notifications_manager_default.cpp | 2 +- .../window/themes/window_theme_warning.cpp | 7 ++----- .../SourceFiles/window/window_lock_widgets.cpp | 4 +--- .../SourceFiles/window/window_setup_email.cpp | 15 ++++++--------- Telegram/lib_ui | 2 +- 78 files changed, 267 insertions(+), 253 deletions(-) diff --git a/Telegram/SourceFiles/boxes/about_box.cpp b/Telegram/SourceFiles/boxes/about_box.cpp index 06ff4addaf..a40f7f6346 100644 --- a/Telegram/SourceFiles/boxes/about_box.cpp +++ b/Telegram/SourceFiles/boxes/about_box.cpp @@ -302,9 +302,8 @@ void ArchiveHintBox( auto button = object_ptr( box, tr::lng_archive_hint_button(), - st::defaultActiveButton); - button->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); + st::defaultActiveButton, + Ui::RoundButtonTextNoTransform); button->resizeToWidth(box->width() - st.buttonPadding.left() - st.buttonPadding.left()); diff --git a/Telegram/SourceFiles/boxes/about_sponsored_box.cpp b/Telegram/SourceFiles/boxes/about_sponsored_box.cpp index f377c34782..113217a177 100644 --- a/Telegram/SourceFiles/boxes/about_sponsored_box.cpp +++ b/Telegram/SourceFiles/boxes/about_sponsored_box.cpp @@ -35,10 +35,10 @@ void AboutSponsoredBox(not_null box) { const auto button = Ui::CreateChild( row, rpl::single(kUrl.utf8()), - st); + st, + RoundButtonTextNoTransform); button->setBrushOverride(Qt::NoBrush); button->setPenOverride(QPen(st::historyLinkInFg)); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); rpl::combine( row->sizeValue(), button->sizeValue() diff --git a/Telegram/SourceFiles/boxes/background_preview_box.cpp b/Telegram/SourceFiles/boxes/background_preview_box.cpp index 24cd9b852b..6a95ecfb28 100644 --- a/Telegram/SourceFiles/boxes/background_preview_box.cpp +++ b/Telegram/SourceFiles/boxes/background_preview_box.cpp @@ -758,7 +758,8 @@ void BackgroundPreviewBox::applyForPeer() { const auto forMe = CreateChild( overlay, tr::lng_background_apply_me(), - st::backgroundConfirm); + st::backgroundConfirm, + RoundButtonTextNoTransform); forMe->setClickedCallback([=] { applyForPeer(false); }); @@ -769,6 +770,7 @@ void BackgroundPreviewBox::applyForPeer() { lt_user, rpl::single(_forPeer->shortName())), st::backgroundConfirm, + RoundButtonTextNoTransform, Data::AmPremiumValue(&_forPeer->session()) | rpl::map(!_1)); forBoth->setClickedCallback([=] { if (_forPeer->session().premium()) { @@ -782,7 +784,8 @@ void BackgroundPreviewBox::applyForPeer() { const auto cancel = CreateChild( overlay, tr::lng_cancel(), - st::backgroundConfirmCancel); + st::backgroundConfirmCancel, + RoundButtonTextNoTransform); cancel->setClickedCallback([=] { const auto raw = _forBothOverlay.release(); raw->shownValue() | rpl::filter( @@ -792,10 +795,6 @@ void BackgroundPreviewBox::applyForPeer() { }), raw->lifetime()); raw->toggle(false, anim::type::normal); }); - forMe->setTextTransform(RoundButton::TextTransform::NoTransform); - forBoth->setTextTransform(RoundButton::TextTransform::NoTransform); - cancel->setTextTransform(RoundButton::TextTransform::NoTransform); - overlay->sizeValue( ) | rpl::on_next([=](QSize size) { const auto padding = st::backgroundConfirmPadding; diff --git a/Telegram/SourceFiles/boxes/local_storage_box.cpp b/Telegram/SourceFiles/boxes/local_storage_box.cpp index 3936aeb492..1bdac1a7f0 100644 --- a/Telegram/SourceFiles/boxes/local_storage_box.cpp +++ b/Telegram/SourceFiles/boxes/local_storage_box.cpp @@ -168,8 +168,7 @@ LocalStorageBox::Row::Row( this, sizeText(data), st::localStorageRowSize) -, _clear(this, std::move(clear), st::localStorageClear) { - _clear->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); +, _clear(this, std::move(clear), st::localStorageClear, Ui::RoundButtonTextNoTransform) { _clear->setVisible(data.count != 0); } diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp index fe2e90d5cf..72c15bac6d 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp @@ -1546,7 +1546,6 @@ not_null CreateProfilePreview( } void ProcessButton(not_null button) { - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); // Raise to be above right emoji from buttons. crl::on_main(button, [=] { button->raise(); }); } @@ -2425,11 +2424,13 @@ void EditPeerColorBox( const auto profileButton = Ui::CreateChild( buttonContainer, tr::lng_settings_color_apply(), - box->getDelegate()->style().button); + box->getDelegate()->style().button, + Ui::RoundButtonTextToUpper); const auto nameButton = Ui::CreateChild( buttonContainer, tr::lng_settings_color_apply(), - box->getDelegate()->style().button); + box->getDelegate()->style().button, + Ui::RoundButtonTextToUpper); rpl::combine( buttonContainer->widthValue(), profileButton->sizeValue(), diff --git a/Telegram/SourceFiles/boxes/select_future_owner_box.cpp b/Telegram/SourceFiles/boxes/select_future_owner_box.cpp index dcefc7d68c..fc138160af 100644 --- a/Telegram/SourceFiles/boxes/select_future_owner_box.cpp +++ b/Telegram/SourceFiles/boxes/select_future_owner_box.cpp @@ -321,7 +321,8 @@ void SelectFutureOwnerbox( !adminsAreEqual ? tr::lng_select_next_owner_box() : tr::lng_select_next_owner_box_admin(), - st::defaultLightButton), + st::defaultLightButton, + Ui::RoundButtonTextNoTransform), st::boxRowPadding, style::al_justify); Ui::AddSkip(content); @@ -329,7 +330,8 @@ void SelectFutureOwnerbox( object_ptr( content, tr::lng_cancel(), - st::defaultLightButton), + st::defaultLightButton, + Ui::RoundButtonTextNoTransform), st::boxRowPadding, style::al_justify); cancel->setClickedCallback([=] { @@ -342,7 +344,8 @@ void SelectFutureOwnerbox( isGroup ? tr::lng_profile_leave_group() : tr::lng_profile_leave_channel(), - st::attentionBoxButton), + st::attentionBoxButton, + Ui::RoundButtonTextNoTransform), st::boxRowPadding, style::al_justify); leave->setClickedCallback([=, revoke = false] { @@ -476,9 +479,8 @@ void SelectFutureOwnerbox( }), tr::lng_select_next_owner_box_confirm(), tr::lng_close()), - st::defaultActiveButton); - button->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); + st::defaultActiveButton, + Ui::RoundButtonTextNoTransform); const auto raw = button.data(); rpl::combine( state->selectionChanges.events() | rpl::map_to(0), @@ -523,7 +525,6 @@ void SelectFutureOwnerbox( }); for (const auto &b : { select, cancel, leave }) { b->setFullRadius(true); - b->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); } box->setStyle(st::futureOwnerBox); } \ No newline at end of file diff --git a/Telegram/SourceFiles/boxes/star_gift_auction_box.cpp b/Telegram/SourceFiles/boxes/star_gift_auction_box.cpp index 81475cff97..4dc7935847 100644 --- a/Telegram/SourceFiles/boxes/star_gift_auction_box.cpp +++ b/Telegram/SourceFiles/boxes/star_gift_auction_box.cpp @@ -1983,9 +1983,9 @@ object_ptr MakeActiveAuctionRow( object_ptr( raw, rpl::single(QString()), - st::auctionListRaise), + st::auctionListRaise, + RoundButtonTextNoTransform), st::auctionListRaisePadding); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); auto secondsLeft = rpl::duplicate( value diff --git a/Telegram/SourceFiles/boxes/star_gift_preview_box.cpp b/Telegram/SourceFiles/boxes/star_gift_preview_box.cpp index 1c35a778e9..3ab7a4a414 100644 --- a/Telegram/SourceFiles/boxes/star_gift_preview_box.cpp +++ b/Telegram/SourceFiles/boxes/star_gift_preview_box.cpp @@ -1556,10 +1556,13 @@ void StarGiftPreviewBox( const style::RoundButton &st, const style::icon &active, Tab tab) { - auto owned = object_ptr(buttonsParent, text(), st); + auto owned = object_ptr( + buttonsParent, + text(), + st, + RoundButtonTextNoTransform); const auto raw = owned.data(); - raw->setTextTransform(RoundButton::TextTransform::NoTransform); raw->setClickedCallback([=] { state->tab = tab; }); diff --git a/Telegram/SourceFiles/boxes/url_auth_box_content.cpp b/Telegram/SourceFiles/boxes/url_auth_box_content.cpp index 291be3d8d1..232751aff1 100644 --- a/Telegram/SourceFiles/boxes/url_auth_box_content.cpp +++ b/Telegram/SourceFiles/boxes/url_auth_box_content.cpp @@ -35,7 +35,6 @@ void PrepareFullWidthRoundButton( not_null button, not_null content, const style::margins &padding) { - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); button->setFullRadius(true); const auto paddingHorizontal = padding.left() + padding.right(); content->widthValue() | rpl::on_next([=](int w) { @@ -83,7 +82,8 @@ void ShowMatchCodesBox( const auto button = Ui::CreateChild( buttons, rpl::single(emojiCode ? QString() : code), - st::urlAuthCodesButton); + st::urlAuthCodesButton, + Ui::RoundButtonTextNoTransform); if (emojiCode) { button->setTextFgOverride(QColor(Qt::transparent)); const auto overlay = Ui::CreateChild(button); @@ -165,7 +165,6 @@ void ShowMatchCodesBox( (overlay->height() - visible) / 2); }); } - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); button->setFullRadius(true); button->setClickedCallback([=] { callback(code); @@ -201,7 +200,8 @@ void ShowMatchCodesBox( object_ptr( content, tr::lng_cancel(), - st::attentionBoxButton), + st::attentionBoxButton, + Ui::RoundButtonTextNoTransform), padding); PrepareFullWidthRoundButton(button, content, padding); button->setClickedCallback([=] { @@ -550,7 +550,8 @@ void ShowDetails( object_ptr( content, tr::lng_url_auth_login_button(), - st::defaultLightButton), + st::defaultLightButton, + Ui::RoundButtonTextNoTransform), padding); PrepareFullWidthRoundButton(button, content, padding); button->setClickedCallback([=] { @@ -587,7 +588,8 @@ void ShowDetails( object_ptr( content, tr::lng_suggest_action_decline(), - st::attentionBoxButton), + st::attentionBoxButton, + Ui::RoundButtonTextNoTransform), padding); PrepareFullWidthRoundButton(button, content, padding); button->setClickedCallback([=] { diff --git a/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp b/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp index e0ed9edc27..c5e9c7c165 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp @@ -257,8 +257,8 @@ void StartRtmpProcess::FillRtmpRows( auto button = Ui::CreateChild( wrap.data(), rpl::duplicate(text), - st::groupCallRtmpCopyButton); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::groupCallRtmpCopyButton, + Ui::RoundButtonTextNoTransform); button->setClickedCallback(key ? Fn([=] { QGuiApplication::clipboard()->setText(state->key.current()); diff --git a/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp b/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp index 3dfc1fa526..dcd402f419 100644 --- a/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp +++ b/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp @@ -260,12 +260,14 @@ ChooseSourceProcess::ChooseSourceProcess( CreateChild( _bottom.get(), tr::lng_group_call_screen_share_start(), - st::desktopCaptureSubmit)) + st::desktopCaptureSubmit, + RoundButtonTextToUpper)) , _finish( CreateChild( _bottom.get(), tr::lng_group_call_screen_share_stop(), - st::desktopCaptureFinish)) + st::desktopCaptureFinish, + RoundButtonTextToUpper)) , _withAudio( CreateChild( _bottom.get(), @@ -369,7 +371,8 @@ void ChooseSourceProcess::setupPanel() { const auto cancel = CreateChild( _bottom.get(), tr::lng_cancel(), - st::desktopCaptureCancel); + st::desktopCaptureCancel, + RoundButtonTextToUpper); cancel->setClickedCallback([=] { _window->close(); }); diff --git a/Telegram/SourceFiles/chat_helpers/ttl_media_layer_widget.cpp b/Telegram/SourceFiles/chat_helpers/ttl_media_layer_widget.cpp index 97a9fb73f9..f0b0aa23b0 100644 --- a/Telegram/SourceFiles/chat_helpers/ttl_media_layer_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/ttl_media_layer_widget.cpp @@ -198,10 +198,10 @@ PreviewWrap::PreviewWrap( item->out() ? tr::lng_close() : tr::lng_ttl_voice_close_in(), - st::ttlMediaButton); + st::ttlMediaButton, + Ui::RoundButtonTextNoTransform); close->setFullRadius(true); close->setClickedCallback(closeCallback); - close->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); rpl::combine( sizeValue(), diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index baa9fb1c6c..98b6f5095b 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -4333,9 +4333,8 @@ void InnerWidget::refreshEmpty() { _emptyButton.create( this, tr::lng_no_conversations_button(), - st::dialogEmptyButton); - _emptyButton->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); + st::dialogEmptyButton, + Ui::RoundButtonTextNoTransform); _emptyButton->setVisible(isListVisible); _emptyButton->setClickedCallback([=, window = _controller] { window->show(PrepareContactsBox(window)); diff --git a/Telegram/SourceFiles/dialogs/ui/dialogs_top_bar_suggestion_content.cpp b/Telegram/SourceFiles/dialogs/ui/dialogs_top_bar_suggestion_content.cpp index b88b8886d7..89bfd36bd0 100644 --- a/Telegram/SourceFiles/dialogs/ui/dialogs_top_bar_suggestion_content.cpp +++ b/Telegram/SourceFiles/dialogs/ui/dialogs_top_bar_suggestion_content.cpp @@ -126,13 +126,13 @@ not_null*> CreateUnconfirmedAuthContent( const auto yes = Ui::CreateChild( buttons, tr::lng_unconfirmed_auth_confirm(), - st::dialogsUnconfirmedAuthButton); + st::dialogsUnconfirmedAuthButton, + Ui::RoundButtonTextNoTransform); const auto no = Ui::CreateChild( buttons, tr::lng_unconfirmed_auth_deny(), - st::dialogsUnconfirmedAuthButtonNo); - yes->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); - no->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::dialogsUnconfirmedAuthButtonNo, + Ui::RoundButtonTextNoTransform); yes->setClickedCallback([=] { wrap->toggle(false, anim::type::normal); base::call_delayed(st::universalDuration, wrap, [=] { @@ -237,7 +237,8 @@ void ShowAuthDeniedBox( object_ptr( box, rpl::single(QString()), - st::defaultActiveButton)); + st::defaultActiveButton, + Ui::RoundButtonTextNoTransform)); confirm->setClickedCallback([=] { box->closeBox(); }); @@ -362,7 +363,8 @@ void TopBarSuggestionContent::setRightButton( _rightButton = base::make_unique_q( this, rpl::single(QString()), - st::dialogsTopBarRightButton); + st::dialogsTopBarRightButton, + RoundButtonTextNoTransform); _rightButton->setText(std::move(text)); rpl::combine( sizeValue(), @@ -372,7 +374,6 @@ void TopBarSuggestionContent::setRightButton( _rightButton->moveToRight(top, top, outer.width()); }, _rightButton->lifetime()); _rightButton->setFullRadius(true); - _rightButton->setTextTransform(RoundButton::TextTransform::NoTransform); _rightButton->setClickedCallback(std::move(callback)); _rightButton->show(); } diff --git a/Telegram/SourceFiles/dialogs/ui/posts_search_intro.cpp b/Telegram/SourceFiles/dialogs/ui/posts_search_intro.cpp index 83d4ce40de..c3a6362bd3 100644 --- a/Telegram/SourceFiles/dialogs/ui/posts_search_intro.cpp +++ b/Telegram/SourceFiles/dialogs/ui/posts_search_intro.cpp @@ -185,9 +185,9 @@ void PostsSearchIntro::setup() { object_ptr( _content.get(), rpl::single(QString()), - st::postsSearchIntroButton), + st::postsSearchIntroButton, + Ui::RoundButtonTextNoTransform), style::al_top); - _button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); _footer = _content->add( object_ptr( _content.get(), diff --git a/Telegram/SourceFiles/export/view/export_view_progress.cpp b/Telegram/SourceFiles/export/view/export_view_progress.cpp index a1746d9313..bec4905c5e 100644 --- a/Telegram/SourceFiles/export/view/export_view_progress.cpp +++ b/Telegram/SourceFiles/export/view/export_view_progress.cpp @@ -277,7 +277,8 @@ ProgressWidget::ProgressWidget( _cancel = base::make_unique_q( this, tr::lng_export_stop(), - st::exportCancelButton); + st::exportCancelButton, + Ui::RoundButtonTextNoTransform); setupBottomButton(_cancel.get()); } @@ -297,7 +298,6 @@ rpl::producer<> ProgressWidget::doneClicks() const { } void ProgressWidget::setupBottomButton(not_null button) { - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); button->show(); sizeValue( @@ -361,7 +361,8 @@ void ProgressWidget::showDone() { _done = base::make_unique_q( this, tr::lng_export_done(), - st::exportDoneButton); + st::exportDoneButton, + Ui::RoundButtonTextNoTransform); const auto desired = std::min( st::exportDoneButton.style.font->width(tr::lng_export_done(tr::now)) + st::exportDoneButton.height diff --git a/Telegram/SourceFiles/export/view/export_view_settings.cpp b/Telegram/SourceFiles/export/view/export_view_settings.cpp index 85c7061cc0..26aa8be841 100644 --- a/Telegram/SourceFiles/export/view/export_view_settings.cpp +++ b/Telegram/SourceFiles/export/view/export_view_settings.cpp @@ -885,10 +885,10 @@ void SettingsWidget::refreshButtons( ? Ui::CreateChild( container.get(), tr::lng_export_start(), - st::defaultBoxButton) + st::defaultBoxButton, + Ui::RoundButtonTextNoTransform) : nullptr; if (start) { - start->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); start->show(); _startClicks = start->clicks() | rpl::to_empty; @@ -903,8 +903,8 @@ void SettingsWidget::refreshButtons( const auto cancel = Ui::CreateChild( container.get(), tr::lng_cancel(), - st::defaultBoxButton); - cancel->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::defaultBoxButton, + Ui::RoundButtonTextNoTransform); cancel->show(); _cancelClicks = cancel->clicks() | rpl::to_empty; diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 31be1ad830..14c11d5c9d 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -5878,11 +5878,10 @@ bool HistoryWidget::updateCmdStartShown() { (_botMenu.text.isEmpty() ? tr::lng_bot_menu_button() : rpl::single(_botMenu.text)), - st::historyBotMenuButton); + st::historyBotMenuButton, + Ui::RoundButtonTextNoTransform); orderWidgets(); - _botMenu.button->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); _botMenu.button->setFullRadius(true); _botMenu.button->setClickedCallback([=] { const auto user = _peer ? _peer->asUser() : nullptr; diff --git a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp index dc997eaa6d..35009d8035 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp @@ -3074,10 +3074,10 @@ void SetupRestrictionView( auto unlock = std::make_unique( widget, rpl::single(text), - st->premiumRequired.button); + st->premiumRequired.button, + RoundButtonTextNoTransform); unlock->show(); unlock->setAttribute(Qt::WA_TransparentForMouseEvents); - unlock->setTextTransform(RoundButton::TextTransform::NoTransform); unlock->setFullRadius(true); return unlock; }; diff --git a/Telegram/SourceFiles/history/view/history_view_contact_status.cpp b/Telegram/SourceFiles/history/view/history_view_contact_status.cpp index db7accde10..e2a0f1e9be 100644 --- a/Telegram/SourceFiles/history/view/history_view_contact_status.cpp +++ b/Telegram/SourceFiles/history/view/history_view_contact_status.cpp @@ -1014,13 +1014,12 @@ BusinessBotStatus::Bar::Bar(QWidget *parent) , _togglePaused( this, rpl::single(QString()), - st::historyBusinessBotToggle) + st::historyBusinessBotToggle, + Ui::RoundButtonTextNoTransform) , _settings(this, st::historyBusinessBotSettings) { _name->setAttribute(Qt::WA_TransparentForMouseEvents); _status->setAttribute(Qt::WA_TransparentForMouseEvents); _togglePaused->setFullRadius(true); - _togglePaused->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); _settings->setClickedCallback([=] { showMenu(); }); diff --git a/Telegram/SourceFiles/history/view/history_view_pinned_bar.cpp b/Telegram/SourceFiles/history/view/history_view_pinned_bar.cpp index 6636fd858c..cb514f6ffa 100644 --- a/Telegram/SourceFiles/history/view/history_view_pinned_bar.cpp +++ b/Telegram/SourceFiles/history/view/history_view_pinned_bar.cpp @@ -170,7 +170,8 @@ auto WithPinnedTitle(not_null session, PinnedId id) { auto button = object_ptr( parent, rpl::never(), // Text is handled by the inner label. - stButton); + stButton, + Ui::RoundButtonTextNoTransform); const auto label = Ui::CreateChild( button.data(), @@ -192,7 +193,6 @@ auto WithPinnedTitle(not_null session, PinnedId id) { label->setTextColorOverride(stButton.textFg->c); // Use button's text color for label. label->setAttribute(Qt::WA_TransparentForMouseEvents); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); button->setFullRadius(true); button->setClickedCallback(std::move(clickCallback)); diff --git a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp index ef854d42d2..caffea103f 100644 --- a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp @@ -1741,8 +1741,8 @@ bool ShowScheduledVideoPublished( const auto button = Ui::CreateChild( widget.get(), rpl::single(view), - st::processingVideoView); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::processingVideoView, + Ui::RoundButtonTextNoTransform); button->show(); rpl::combine( widget->sizeValue(), diff --git a/Telegram/SourceFiles/history/view/history_view_sticker_toast.cpp b/Telegram/SourceFiles/history/view/history_view_sticker_toast.cpp index 45a7dbc0f9..94131da727 100644 --- a/Telegram/SourceFiles/history/view/history_view_sticker_toast.cpp +++ b/Telegram/SourceFiles/history/view/history_view_sticker_toast.cpp @@ -201,8 +201,8 @@ void StickerToast::showWithTitle(const QString &title) { const auto button = Ui::CreateChild( widget.get(), rpl::single(view), - st::historyPremiumViewSet); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::historyPremiumViewSet, + Ui::RoundButtonTextNoTransform); button->show(); rpl::combine( widget->sizeValue(), 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 a80e5ed695..56a6f0973e 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -117,10 +117,10 @@ TopBarWidget::TopBarWidget( : RpWidget(parent) , _controller(controller) , _primaryWindow(controller->isPrimary()) -, _clear(this, tr::lng_selected_clear(), st::topBarClearButton) -, _forward(this, tr::lng_selected_forward(), st::defaultActiveButton) -, _sendNow(this, tr::lng_selected_send_now(), st::defaultActiveButton) -, _delete(this, tr::lng_selected_delete(), st::defaultActiveButton) +, _clear(this, tr::lng_selected_clear(), st::topBarClearButton, Ui::RoundButtonTextToUpper) +, _forward(this, tr::lng_selected_forward(), st::defaultActiveButton, Ui::RoundButtonTextToUpper) +, _sendNow(this, tr::lng_selected_send_now(), st::defaultActiveButton, Ui::RoundButtonTextToUpper) +, _delete(this, tr::lng_selected_delete(), st::defaultActiveButton, Ui::RoundButtonTextToUpper) , _back(this, st::historyTopBarBack) , _cancelChoose(this, st::topBarCloseChoose) , _call(this, st::topBarCall) diff --git a/Telegram/SourceFiles/history/view/history_view_translate_bar.cpp b/Telegram/SourceFiles/history/view/history_view_translate_bar.cpp index 887c7ff0d3..e117aa12e6 100644 --- a/Telegram/SourceFiles/history/view/history_view_translate_bar.cpp +++ b/Telegram/SourceFiles/history/view/history_view_translate_bar.cpp @@ -599,8 +599,8 @@ void TranslateBar::showToast( const auto button = Ui::CreateChild( widget.get(), rpl::single(buttonText), - st::historyPremiumViewSet); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::historyPremiumViewSet, + Ui::RoundButtonTextNoTransform); button->show(); rpl::combine( widget->sizeValue(), diff --git a/Telegram/SourceFiles/info/bot/starref/info_bot_starref_setup_widget.cpp b/Telegram/SourceFiles/info/bot/starref/info_bot_starref_setup_widget.cpp index ffff738e9c..af6b57b99e 100644 --- a/Telegram/SourceFiles/info/bot/starref/info_bot_starref_setup_widget.cpp +++ b/Telegram/SourceFiles/info/bot/starref/info_bot_starref_setup_widget.cpp @@ -447,7 +447,8 @@ private: auto result = object_ptr( parent, rpl::single(QString()), - st::starrefBottomButton); + st::starrefBottomButton, + Ui::RoundButtonTextToUpper); const auto raw = result.data(); rpl::combine( parent->widthValue(), diff --git a/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp b/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp index ca66330a8b..091f717cc1 100644 --- a/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp +++ b/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp @@ -1344,7 +1344,8 @@ void CreateGiveawayBox( auto button = object_ptr( box, rpl::never(), - st::giveawayGiftCodeStartButton); + st::giveawayGiftCodeStartButton, + Ui::RoundButtonTextNoTransform); AddLabelWithBadgeToButton( button, @@ -1379,7 +1380,6 @@ void CreateGiveawayBox( loadingAnimation->showOn(state->confirmButtonBusy.value()); } - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); state->typeValue.value( ) | rpl::on_next([=, raw = button.data()] { raw->resizeToWidth(box->width() diff --git a/Telegram/SourceFiles/info/channel_statistics/boosts/info_boosts_inner_widget.cpp b/Telegram/SourceFiles/info/channel_statistics/boosts/info_boosts_inner_widget.cpp index c527b7690d..cf8e330635 100644 --- a/Telegram/SourceFiles/info/channel_statistics/boosts/info_boosts_inner_widget.cpp +++ b/Telegram/SourceFiles/info/channel_statistics/boosts/info_boosts_inner_widget.cpp @@ -202,14 +202,14 @@ void FillShareLink( const auto copy = CreateChild( wrap, tr::lng_group_invite_context_copy(), - st::inviteLinkCopy); - copy->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::inviteLinkCopy, + Ui::RoundButtonTextNoTransform); copy->setClickedCallback(copyLink); const auto share = CreateChild( wrap, tr::lng_group_invite_context_share(), - st::inviteLinkShare); - share->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::inviteLinkShare, + Ui::RoundButtonTextNoTransform); share->setClickedCallback(shareLink); wrap->widthValue( diff --git a/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp b/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp index 64c791018b..eda9510d4f 100644 --- a/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp +++ b/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp @@ -144,7 +144,8 @@ void AddRecipient(not_null box, const TextWithEntities &t) { object_ptr( box, rpl::single(QString()), - st::channelEarnHistoryRecipientButton), + st::channelEarnHistoryRecipientButton, + Ui::RoundButtonTextToUpper), style::al_top); const auto label = Ui::CreateChild( container, @@ -593,9 +594,8 @@ void InnerWidget::fill() { auto button = object_ptr( container, tr::lng_channel_earn_learn_close(), - st::defaultActiveButton); - button->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); + st::defaultActiveButton, + Ui::RoundButtonTextNoTransform); button->resizeToWidth(box->width() - st.buttonPadding.left() - st.buttonPadding.left()); @@ -884,7 +884,8 @@ void InnerWidget::fill() { object_ptr( container, rpl::never(), - stButton), + stButton, + Ui::RoundButtonTextToUpper), st::boxRowPadding, style::al_justify); @@ -1236,7 +1237,8 @@ void InnerWidget::fill() { (!entry.successLink.isEmpty()) ? tr::lng_channel_earn_history_out_button() : tr::lng_box_ok(), - st::defaultActiveButton); + st::defaultActiveButton, + Ui::RoundButtonTextToUpper); button->resizeToWidth(box->width() - st.buttonPadding.left() - st.buttonPadding.left()); diff --git a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp index f27c2b02dc..38512b4905 100644 --- a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp +++ b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp @@ -1305,15 +1305,14 @@ void InnerWidget::refreshAbout() { object_ptr( about.get(), rpl::single(QString()), - st::collectionEmptyButton), + st::collectionEmptyButton, + Ui::RoundButtonTextNoTransform), st::collectionEmptyAddMargin, style::al_top); button->setText(tr::lng_gift_collection_add_button( ) | rpl::map([](const QString &text) { return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text); })); - button->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); button->setClickedCallback([=] { editCollectionGifts(collectionId); }); @@ -2496,8 +2495,8 @@ void Widget::setupBottomButton(int wasBottomHeight) { const auto button = Ui::CreateChild( bottom, rpl::single(QString()), - st::collectionEditBox.button); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::collectionEditBox.button, + Ui::RoundButtonTextNoTransform); button->setText(tr::lng_gift_collection_add_button( ) | rpl::map([](const QString &text) { return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text); diff --git a/Telegram/SourceFiles/info/polls/info_polls_list_widget.cpp b/Telegram/SourceFiles/info/polls/info_polls_list_widget.cpp index 11d7521136..67d56caf45 100644 --- a/Telegram/SourceFiles/info/polls/info_polls_list_widget.cpp +++ b/Telegram/SourceFiles/info/polls/info_polls_list_widget.cpp @@ -269,9 +269,8 @@ void ListWidget::Inner::setupHistory() { _newPollButton.create( _scroll.get(), tr::lng_polls_create_title(), - st::defaultActiveButton); - _newPollButton->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); + st::defaultActiveButton, + Ui::RoundButtonTextNoTransform); _newPollButton->setFullRadius(true); _newPollButton->setClickedCallback([=] { Window::PeerMenuCreatePoll( diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index edf4d836bc..9c0369d112 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -394,7 +394,8 @@ base::options::toggle ShowChannelJoinedBelowAbout({ object_ptr( parent, rpl::single(QString()), - st::infoHoursOuter), + st::infoHoursOuter, + Ui::RoundButtonTextToUpper), st::infoProfileLabeledPadding - st::infoHoursOuterMargin); const auto button = result->entity(); const auto inner = Ui::CreateChild(button); @@ -632,8 +633,8 @@ base::options::toggle ShowChannelJoinedBelowAbout({ const auto link = Ui::CreateChild( labelWrap, std::move(linkText), - st::defaultTableSmallButton); - link->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::defaultTableSmallButton, + Ui::RoundButtonTextNoTransform); link->setClickedCallback([=] { state->myTimezone = !state->myTimezone.current(); state->expanded = true; @@ -882,7 +883,8 @@ void DeleteContactNote( object_ptr( parent, rpl::single(QString()), - st::infoHoursOuter), + st::infoHoursOuter, + Ui::RoundButtonTextToUpper), st::infoProfileLabeledPadding - st::infoHoursOuterMargin); result->setDuration(st::infoSlideDuration); const auto button = result->entity(); @@ -2131,10 +2133,10 @@ void DetailsFiller::setupMainApp(bool suppressBottom) { object_ptr( _wrap, tr::lng_profile_open_app(), - st::infoOpenApp), + st::infoOpenApp, + Ui::RoundButtonTextNoTransform), st::infoOpenAppMargin, style::al_justify); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); const auto user = _peer->asUser(); const auto controller = _controller->parentController(); diff --git a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp index be55f17a7f..59f0533907 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp @@ -328,7 +328,8 @@ TopBar::TopBar( object_ptr( this, tr::lng_status_lastseen_when(), - st::infoProfileTopBarShowLastSeen)) + st::infoProfileTopBarShowLastSeen, + Ui::RoundButtonTextNoTransform)) , _forumButton([&, controller = descriptor.controller] { const auto topic = _key.topic(); if (!topic) { @@ -337,7 +338,8 @@ TopBar::TopBar( auto owned = object_ptr( this, rpl::single(QString()), - st::infoProfileTopBarTopicStatusButton); + st::infoProfileTopBarTopicStatusButton, + Ui::RoundButtonTextNoTransform); owned->setText(Info::Profile::NameValue( _peer ) | rpl::map([=](const QString &name) { @@ -345,7 +347,6 @@ TopBar::TopBar( .append(' ') .append(Ui::Text::IconEmoji(&st::textMoreIconEmoji, QString())); })); - owned->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); owned->setClickedCallback([=, peer = _peer] { if (const auto forum = peer->forum()) { if (peer->useSubsectionTabs()) { @@ -2133,8 +2134,6 @@ void TopBar::setupShowLastSeen( _showLastSeen->setOpacity(0.); - using TextTransform = Ui::RoundButton::TextTransform; - _showLastSeen->entity()->setTextTransform(TextTransform::NoTransform); _showLastSeen->entity()->setFullRadius(true); _showLastSeen->entity()->setClickedCallback([=] { diff --git a/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp b/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp index f67b18f090..9a993f9eaf 100644 --- a/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp +++ b/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp @@ -156,6 +156,7 @@ void ListController::setupUnlock() { ? tr::lng_similar_channels_show_more() : tr::lng_similar_bots_show_more()), st::similarChannelsLock, + Ui::RoundButtonTextToUpper, rpl::single(true)); button->setClickedCallback([=] { const auto window = _controller->parentController(); diff --git a/Telegram/SourceFiles/info/stories/info_stories_inner_widget.cpp b/Telegram/SourceFiles/info/stories/info_stories_inner_widget.cpp index 93b61df858..c22174e3c9 100644 --- a/Telegram/SourceFiles/info/stories/info_stories_inner_widget.cpp +++ b/Telegram/SourceFiles/info/stories/info_stories_inner_widget.cpp @@ -717,15 +717,14 @@ void InnerWidget::refreshEmpty() { object_ptr( empty.get(), rpl::single(QString()), - st::collectionEmptyButton), + st::collectionEmptyButton, + Ui::RoundButtonTextNoTransform), st::collectionEmptyAddMargin, style::al_top); button->setText(tr::lng_stories_album_add_button( ) | rpl::map([](const QString &text) { return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text); })); - button->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); button->setClickedCallback([=] { editAlbumStories(albumId); }); diff --git a/Telegram/SourceFiles/info/stories/info_stories_widget.cpp b/Telegram/SourceFiles/info/stories/info_stories_widget.cpp index 4c7f98689e..e641def468 100644 --- a/Telegram/SourceFiles/info/stories/info_stories_widget.cpp +++ b/Telegram/SourceFiles/info/stories/info_stories_widget.cpp @@ -230,8 +230,8 @@ void Widget::setupBottomButton(int wasBottomHeight) { const auto button = Ui::CreateChild( bottom, rpl::single(QString()), - st::collectionEditBox.button); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::collectionEditBox.button, + Ui::RoundButtonTextNoTransform); button->setText(tr::lng_stories_album_add_button( ) | rpl::map([](const QString &text) { return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text); diff --git a/Telegram/SourceFiles/info/userpic/info_userpic_emoji_builder.cpp b/Telegram/SourceFiles/info/userpic/info_userpic_emoji_builder.cpp index cb725eb0d1..e32c273f94 100644 --- a/Telegram/SourceFiles/info/userpic/info_userpic_emoji_builder.cpp +++ b/Telegram/SourceFiles/info/userpic/info_userpic_emoji_builder.cpp @@ -44,8 +44,8 @@ void ShowLayer( const auto save = Ui::CreateChild( content.get(), tr::lng_connection_save(), - st::userpicBuilderEmojiButton); - save->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::userpicBuilderEmojiButton, + Ui::RoundButtonTextNoTransform); content->sizeValue( ) | rpl::on_next([=] { const auto &p = st::userpicBuilderEmojiSavePosiiton; diff --git a/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp b/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp index c96ee1631d..672e46980e 100644 --- a/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp @@ -512,9 +512,8 @@ void Inner::refreshSwitchPmButton(const CacheEntry *entry) { _switchPmUrl = QByteArray(); } else { if (!_switchPmButton) { - _switchPmButton.create(this, nullptr, st::switchPmButton); + _switchPmButton.create(this, nullptr, st::switchPmButton, Ui::RoundButtonTextNoTransform); _switchPmButton->show(); - _switchPmButton->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); _switchPmButton->addClickHandler([=] { switchPm(); }); } _switchPmButton->setText(rpl::single(entry->switchPmText)); diff --git a/Telegram/SourceFiles/intro/intro_widget.cpp b/Telegram/SourceFiles/intro/intro_widget.cpp index 096d61ce0f..daa8f822e4 100644 --- a/Telegram/SourceFiles/intro/intro_widget.cpp +++ b/Telegram/SourceFiles/intro/intro_widget.cpp @@ -84,10 +84,11 @@ Widget::Widget( object_ptr( this, tr::lng_menu_settings(), - st::defaultBoxButton)) + st::defaultBoxButton, + Ui::RoundButtonTextToUpper)) , _next( this, - object_ptr(this, nullptr, *_nextStyle)) + object_ptr(this, nullptr, *_nextStyle, Ui::RoundButtonTextNoTransform)) , _connecting(std::make_unique( this, account, @@ -318,7 +319,8 @@ void Widget::checkUpdateStatus() { object_ptr( this, tr::lng_menu_update(), - st::defaultBoxButton)); + st::defaultBoxButton, + Ui::RoundButtonTextToUpper)); if (!_showAnimation) { _update->setVisible(true); } @@ -353,7 +355,7 @@ void Widget::setupStep() { _next.destroy(); _next.create( this, - object_ptr(this, nullptr, *nextStyle)); + object_ptr(this, nullptr, *nextStyle, Ui::RoundButtonTextNoTransform)); showControls(); updateControlsGeometry(); _next->toggle(wasShown, anim::type::instant); @@ -492,7 +494,8 @@ void Widget::showResetButton() { auto entity = object_ptr( this, tr::lng_signin_reset_account(), - st::introResetButton); + st::introResetButton, + Ui::RoundButtonTextToUpper); _resetAccount.create(this, std::move(entity)); _resetAccount->hide(anim::type::instant); _resetAccount->entity()->setClickedCallback([this] { resetAccount(); }); @@ -723,8 +726,6 @@ void Widget::showControls() { void Widget::setupNextButton() { _next->entity()->setClickedCallback([=] { getStep()->submit(); }); - _next->entity()->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); _next->entity()->setText(getStep()->nextButtonText( ) | rpl::filter([](const QString &text) { diff --git a/Telegram/SourceFiles/iv/iv_controller.cpp b/Telegram/SourceFiles/iv/iv_controller.cpp index c03e1c9877..343874b215 100644 --- a/Telegram/SourceFiles/iv/iv_controller.cpp +++ b/Telegram/SourceFiles/iv/iv_controller.cpp @@ -97,14 +97,14 @@ public: const auto reset = Ui::CreateChild( this, rpl::single(QString()), - st::ivResetZoom); + st::ivResetZoom, + Ui::RoundButtonTextNoTransform); processTooltip(reset); const auto resetLabel = Ui::CreateChild( reset, tr::lng_background_reset_default(), st::ivResetZoomLabel); resetLabel->setAttribute(Qt::WA_TransparentForMouseEvents); - reset->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); reset->setClickedCallback([this] { _delegate->ivSetZoom(0); }); diff --git a/Telegram/SourceFiles/media/stories/media_stories_controller.cpp b/Telegram/SourceFiles/media/stories/media_stories_controller.cpp index e552172244..8a1aca63c9 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_controller.cpp +++ b/Telegram/SourceFiles/media/stories/media_stories_controller.cpp @@ -265,8 +265,8 @@ void Controller::Unsupported::setup(not_null peer) { _button = std::make_unique( wrap, tr::lng_update_telegram(), - st::storiesUnsupportedUpdate); - _button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::storiesUnsupportedUpdate, + Ui::RoundButtonTextNoTransform); _button->show(); rpl::combine( diff --git a/Telegram/SourceFiles/media/stories/media_stories_stealth.cpp b/Telegram/SourceFiles/media/stories/media_stories_stealth.cpp index 89b8d533ae..494d0cd1d0 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_stealth.cpp +++ b/Telegram/SourceFiles/media/stories/media_stories_stealth.cpp @@ -240,7 +240,8 @@ struct State { auto result = object_ptr( parent, rpl::single(QString()), - st.box.button); + st.box.button, + Ui::RoundButtonTextToUpper); const auto raw = result.data(); const auto label = Ui::CreateChild( diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index bace1de7de..f2f1552b23 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -1791,12 +1791,11 @@ void OverlayWidget::refreshVoteButton() { return; } if (!_voteButton) { - using TextTransform = Ui::RoundButton::TextTransform; _voteButton.create( _body, tr::lng_polls_submit_votes(), - st::mediaviewVoteButton); - _voteButton->setTextTransform(TextTransform::NoTransform); + st::mediaviewVoteButton, + Ui::RoundButtonTextNoTransform); const auto effect = Ui::CreateChild( _voteButton.data()); effect->setOpacity(_controlsOpacity.current()); @@ -4907,12 +4906,11 @@ void OverlayWidget::initThemePreview() { _themePreviewId = 0; _themePreview = std::move(result); if (_themePreview) { - using TextTransform = Ui::RoundButton::TextTransform; _themeApply.create( _body, tr::lng_theme_preview_apply(), - st::themePreviewApplyButton); - _themeApply->setTextTransform(TextTransform::NoTransform); + st::themePreviewApplyButton, + Ui::RoundButtonTextNoTransform); _themeApply->show(); _themeApply->setClickedCallback([=] { const auto &object = Background()->themeObject(); @@ -4928,16 +4926,16 @@ void OverlayWidget::initThemePreview() { _themeCancel.create( _body, tr::lng_cancel(), - st::themePreviewCancelButton); - _themeCancel->setTextTransform(TextTransform::NoTransform); + st::themePreviewCancelButton, + Ui::RoundButtonTextNoTransform); _themeCancel->show(); _themeCancel->setClickedCallback([this] { close(); }); if (const auto slug = _themeCloudData.slug; !slug.isEmpty()) { _themeShare.create( _body, tr::lng_theme_share(), - st::themePreviewCancelButton); - _themeShare->setTextTransform(TextTransform::NoTransform); + st::themePreviewCancelButton, + Ui::RoundButtonTextNoTransform); _themeShare->show(); _themeShare->setClickedCallback([=] { QGuiApplication::clipboard()->setText( diff --git a/Telegram/SourceFiles/media/view/media_view_playback_sponsored.cpp b/Telegram/SourceFiles/media/view/media_view_playback_sponsored.cpp index 805f31003a..ce490ac96f 100644 --- a/Telegram/SourceFiles/media/view/media_view_playback_sponsored.cpp +++ b/Telegram/SourceFiles/media/view/media_view_playback_sponsored.cpp @@ -325,13 +325,13 @@ PlaybackSponsored::Message::Message( , _about(std::make_unique( this, tr::lng_search_sponsored_button(), - _aboutSt)) + _aboutSt, + Ui::RoundButtonTextNoTransform)) , _close( std::make_unique( this, _aboutSt.ripple, std::move(allowCloseAt))) { - _about->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); setMouseTracking(true); populate(); hide(); diff --git a/Telegram/SourceFiles/menu/menu_sponsored.cpp b/Telegram/SourceFiles/menu/menu_sponsored.cpp index 83340bcb03..debcbeac8b 100644 --- a/Telegram/SourceFiles/menu/menu_sponsored.cpp +++ b/Telegram/SourceFiles/menu/menu_sponsored.cpp @@ -248,7 +248,8 @@ void AboutBox( auto button = object_ptr( box, tr::lng_box_ok(), - st::defaultActiveButton); + st::defaultActiveButton, + Ui::RoundButtonTextToUpper); button->resizeToWidth(box->width() - st.buttonPadding.left() - st.buttonPadding.left()); diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp index 4f1251c9b3..dd7c1063cb 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp @@ -141,15 +141,14 @@ void VerifyBox::setupControls( object_ptr( _content, tr::lng_intro_fragment_button(), - st::fragmentBoxButton), + st::fragmentBoxButton, + Ui::RoundButtonTextNoTransform), small); _content->widthValue( ) | rpl::on_next([=](int w) { button->setFullWidth(w - small.left() - small.right()); }, button->lifetime()); button->setClickedCallback([=] { ::File::OpenUrl(openUrl); }); - button->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); } if (resend) { auto link = TextWithEntities{ tr::lng_cloud_password_resend(tr::now) }; @@ -237,7 +236,8 @@ PanelEditContact::PanelEditContact( , _done( this, tr::lng_passport_save_value(), - st::passportPanelSaveValue) { + st::passportPanelSaveValue, + Ui::RoundButtonTextToUpper) { setupControls(data, existing); } diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp index e8da525cb8..830a497b0a 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp @@ -221,7 +221,8 @@ PanelEditDocument::PanelEditDocument( , _done( this, tr::lng_passport_save_value(), - st::passportPanelSaveValue) { + st::passportPanelSaveValue, + Ui::RoundButtonTextToUpper) { setupControls( &error, &data, @@ -247,7 +248,8 @@ PanelEditDocument::PanelEditDocument( , _done( this, tr::lng_passport_save_value(), - st::passportPanelSaveValue) { + st::passportPanelSaveValue, + Ui::RoundButtonTextToUpper) { setupControls( nullptr, nullptr, @@ -270,7 +272,8 @@ PanelEditDocument::PanelEditDocument( , _done( this, tr::lng_passport_save_value(), - st::passportPanelSaveValue) { + st::passportPanelSaveValue, + Ui::RoundButtonTextToUpper) { setupControls(&error, &data, nullptr, nullptr, {}, {}, {}); } diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp index fcc631ce66..6d43841ee1 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp @@ -326,7 +326,8 @@ ScanButton::ScanButton( object_ptr( this, tr::lng_passport_delete_scan_undo(), - _st.restore)) { + _st.restore, + Ui::RoundButtonTextToUpper)) { _delete->toggle(!deleted, anim::type::instant); _restore->toggle(deleted, anim::type::instant); } diff --git a/Telegram/SourceFiles/passport/passport_panel_form.cpp b/Telegram/SourceFiles/passport/passport_panel_form.cpp index 4710c4a1ba..5ddb2f1aef 100644 --- a/Telegram/SourceFiles/passport/passport_panel_form.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_form.cpp @@ -40,7 +40,8 @@ PanelForm::PanelForm( , _submit( this, tr::lng_passport_authorize(), - st::passportPanelAuthorize) { + st::passportPanelAuthorize, + Ui::RoundButtonTextToUpper) { setupControls(); } diff --git a/Telegram/SourceFiles/passport/passport_panel_password.cpp b/Telegram/SourceFiles/passport/passport_panel_password.cpp index 1df93f51ec..b60ccd9da3 100644 --- a/Telegram/SourceFiles/passport/passport_panel_password.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_password.cpp @@ -47,7 +47,7 @@ PanelAskPassword::PanelAskPassword( this, st::defaultInputField, tr::lng_passport_password_placeholder()) -, _submit(this, tr::lng_passport_next(), st::passportPasswordSubmit) +, _submit(this, tr::lng_passport_next(), st::passportPasswordSubmit, Ui::RoundButtonTextToUpper) , _forgot(this, tr::lng_signin_recover(tr::now), st::defaultLinkButton) { connect(_password, &Ui::PasswordInput::submitted, this, [=] { submit(); @@ -227,7 +227,8 @@ void PanelNoPassword::refreshBottom() { object_ptr( _inner, tr::lng_passport_password_create(), - st::defaultBoxButton), + st::defaultBoxButton, + Ui::RoundButtonTextToUpper), style::al_top); button->addClickHandler([=] { _controller->setupPassword(); @@ -240,18 +241,16 @@ void PanelNoPassword::refreshBottom() { const auto cancel = Ui::CreateChild( container, tr::lng_cancel(), - st::defaultBoxButton); - cancel->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); + st::defaultBoxButton, + Ui::RoundButtonTextNoTransform); cancel->addClickHandler([=] { _controller->cancelPasswordSubmit(); }); const auto validate = Ui::CreateChild( container, tr::lng_passport_email_validate(), - st::defaultBoxButton); - validate->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); + st::defaultBoxButton, + Ui::RoundButtonTextNoTransform); validate->addClickHandler([=] { _controller->validateRecoveryEmail(); }); diff --git a/Telegram/SourceFiles/payments/ui/payments_edit_card.cpp b/Telegram/SourceFiles/payments/ui/payments_edit_card.cpp index 7dbcbee985..05e93e9e7d 100644 --- a/Telegram/SourceFiles/payments/ui/payments_edit_card.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_edit_card.cpp @@ -216,11 +216,13 @@ EditCard::EditCard( , _submit( this, tr::lng_about_done(), - st::paymentsPanelButton) + st::paymentsPanelButton, + RoundButtonTextToUpper) , _cancel( this, tr::lng_cancel(), - st::paymentsPanelButton) { + st::paymentsPanelButton, + RoundButtonTextToUpper) { setupControls(); } diff --git a/Telegram/SourceFiles/payments/ui/payments_edit_information.cpp b/Telegram/SourceFiles/payments/ui/payments_edit_information.cpp index 7f15574587..fe5c8261cb 100644 --- a/Telegram/SourceFiles/payments/ui/payments_edit_information.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_edit_information.cpp @@ -47,11 +47,13 @@ EditInformation::EditInformation( , _submit( this, tr::lng_settings_save(), - st::paymentsPanelButton) + st::paymentsPanelButton, + RoundButtonTextToUpper) , _cancel( this, tr::lng_cancel(), - st::paymentsPanelButton) { + st::paymentsPanelButton, + RoundButtonTextToUpper) { setupControls(); } diff --git a/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp b/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp index 00e5ec49eb..9718e67499 100644 --- a/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp @@ -83,13 +83,15 @@ FormSummary::FormSummary( tr::lng_payments_pay_amount( lt_amount, rpl::single(formatAmount(computeTotalAmount()))), - st::paymentsPanelSubmit)) + st::paymentsPanelSubmit, + RoundButtonTextNoTransform)) , _cancel( this, (_invoice.receipt.paid ? tr::lng_about_done() : tr::lng_cancel()), - st::paymentsPanelButton) + st::paymentsPanelButton, + RoundButtonTextNoTransform) , _tipLightBg(TransparentColor(st::paymentsTipActive, kLightOpacity)) , _tipLightRipple( TransparentColor(st::paymentsTipActive, kLightRippleOpacity)) @@ -170,13 +172,10 @@ void FormSummary::setupControls() { setupContent(_layout.get()); if (_submit) { - _submit->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); _submit->addClickHandler([=] { _delegate->panelSubmit(); }); } - _cancel->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); _cancel->addClickHandler([=] { _delegate->panelRequestClose(); }); @@ -398,7 +397,8 @@ void FormSummary::setupSuggestedTips(not_null layout) { .widget = CreateChild( outer, rpl::single(formatAmount(amount, true)), - st), + st, + RoundButtonTextNoTransform), }); auto &button = state->buttons.back(); button.widget->show(); diff --git a/Telegram/SourceFiles/settings/cloud_password/settings_cloud_password_common.cpp b/Telegram/SourceFiles/settings/cloud_password/settings_cloud_password_common.cpp index b9917e268b..1f2ce04990 100644 --- a/Telegram/SourceFiles/settings/cloud_password/settings_cloud_password_common.cpp +++ b/Telegram/SourceFiles/settings/cloud_password/settings_cloud_password_common.cpp @@ -229,10 +229,10 @@ not_null AddDoneButton( object_ptr( content, std::move(text), - st::changePhoneButton), + st::changePhoneButton, + Ui::RoundButtonTextNoTransform), st::settingLocalPasscodeButtonPadding, style::al_top); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); return button; } diff --git a/Telegram/SourceFiles/settings/sections/settings_credits.cpp b/Telegram/SourceFiles/settings/sections/settings_credits.cpp index 942f63d67a..21b9fc0b56 100644 --- a/Telegram/SourceFiles/settings/sections/settings_credits.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_credits.cpp @@ -496,7 +496,8 @@ void Credits::setupContent() { object_ptr( content, nullptr, - st::creditsSettingsBigBalanceButton), + st::creditsSettingsBigBalanceButton, + Ui::RoundButtonTextNoTransform), st::boxRowPadding, style::al_top); button->setContext([&]() -> Ui::Text::MarkedContext { @@ -534,7 +535,6 @@ void Credits::setupContent() { lt_emoji, rpl::single(Ui::Text::SingleCustomEmoji(u"+"_q)), tr::marked))); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); const auto show = controller()->uiShow(); if (isCurrency) { const auto url = tr::lng_suggest_low_ton_fragment_url(tr::now); @@ -866,7 +866,8 @@ void BuildCurrencyWithdrawalSection( object_ptr( container, rpl::never(), - stButton), + stButton, + Ui::RoundButtonTextToUpper), st::boxRowPadding, style::al_top); diff --git a/Telegram/SourceFiles/settings/sections/settings_folders.cpp b/Telegram/SourceFiles/settings/sections/settings_folders.cpp index 952c17ad41..d19dcfb1ed 100644 --- a/Telegram/SourceFiles/settings/sections/settings_folders.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_folders.cpp @@ -180,15 +180,14 @@ FilterRowButton::FilterRowButton( : RippleButton(parent, st::defaultRippleAnimation) , _session(session) , _remove(this, st::filtersRemove) -, _restore(this, tr::lng_filters_restore(), st::settingsFilterAddRecommended) +, _restore(this, tr::lng_filters_restore(), st::settingsFilterAddRecommended, Ui::RoundButtonTextNoTransform) , _add( this, tr::lng_filters_recommended_add(), - st::settingsFilterAddRecommended) + st::settingsFilterAddRecommended, + Ui::RoundButtonTextNoTransform) , _state(description.isEmpty() ? State::Normal : State::Suggested) { - _restore.setTextTransform(Ui::RoundButton::TextTransform::NoTransform); _restore.setFullRadius(true); - _add.setTextTransform(Ui::RoundButton::TextTransform::NoTransform); _add.setFullRadius(true); setup(filter, description.isEmpty() ? ComputeCountString(session, filter) diff --git a/Telegram/SourceFiles/settings/sections/settings_local_passcode.cpp b/Telegram/SourceFiles/settings/sections/settings_local_passcode.cpp index 7b44182a85..2bcc29a511 100644 --- a/Telegram/SourceFiles/settings/sections/settings_local_passcode.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_local_passcode.cpp @@ -209,10 +209,10 @@ void LocalPasscodeEnter::setupContent() { : isCheck ? tr::lng_passcode_check_button() : tr::lng_passcode_change_button()), - st::changePhoneButton), + st::changePhoneButton, + Ui::RoundButtonTextNoTransform), st::settingLocalPasscodeButtonPadding, style::al_top); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); button->setClickedCallback([=] { const auto newText = newPasscode->text(); const auto reenterText = reenterPasscode diff --git a/Telegram/SourceFiles/settings/sections/settings_main.cpp b/Telegram/SourceFiles/settings/sections/settings_main.cpp index b8d8bb7fcd..fa48873808 100644 --- a/Telegram/SourceFiles/settings/sections/settings_main.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_main.cpp @@ -852,8 +852,8 @@ void SetupValidatePhoneNumberSuggestion( const auto yes = Ui::CreateChild( wrap, tr::lng_box_yes(), - st::inviteLinkButton); - yes->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::inviteLinkButton, + Ui::RoundButtonTextNoTransform); yes->setClickedCallback([=] { controller->session().promoSuggestions().dismiss( kSugValidatePhone.utf8()); @@ -862,8 +862,8 @@ void SetupValidatePhoneNumberSuggestion( const auto no = Ui::CreateChild( wrap, tr::lng_box_no(), - st::inviteLinkButton); - no->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::inviteLinkButton, + Ui::RoundButtonTextNoTransform); no->setClickedCallback([=] { const auto sharedLabel = std::make_shared>(); const auto height = st::boxLabel.style.font->height; @@ -954,8 +954,8 @@ void SetupValidatePasswordSuggestion( const auto yes = Ui::CreateChild( wrap, tr::lng_settings_suggestion_password_yes(), - st::inviteLinkButton); - yes->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::inviteLinkButton, + Ui::RoundButtonTextNoTransform); yes->setClickedCallback([=] { controller->session().promoSuggestions().dismiss( Data::PromoSuggestions::SugValidatePassword()); @@ -964,8 +964,8 @@ void SetupValidatePasswordSuggestion( const auto no = Ui::CreateChild( wrap, tr::lng_settings_suggestion_password_no(), - st::inviteLinkButton); - no->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::inviteLinkButton, + Ui::RoundButtonTextNoTransform); no->setClickedCallback([=] { showOther(Settings::CloudPasswordSuggestionInputId()); }); diff --git a/Telegram/SourceFiles/settings/sections/settings_passkeys.cpp b/Telegram/SourceFiles/settings/sections/settings_passkeys.cpp index f762a3a0df..bc3f869d4c 100644 --- a/Telegram/SourceFiles/settings/sections/settings_passkeys.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_passkeys.cpp @@ -453,9 +453,9 @@ void PasskeysNoneBox( canRegister ? tr::lng_settings_passkeys_none_button() : tr::lng_settings_passkeys_none_button_unsupported(), - st::defaultActiveButton); + st::defaultActiveButton, + Ui::RoundButtonTextNoTransform); const auto createButton = button.data(); - button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); button->resizeToWidth(box->width() - st.buttonPadding.left() - st.buttonPadding.left()); diff --git a/Telegram/SourceFiles/settings/sections/settings_premium.cpp b/Telegram/SourceFiles/settings/sections/settings_premium.cpp index b3f606f975..3cde34a72b 100644 --- a/Telegram/SourceFiles/settings/sections/settings_premium.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_premium.cpp @@ -1937,11 +1937,13 @@ not_null CreateLockedButton( not_null parent, rpl::producer text, const style::RoundButton &st, + Ui::RoundButtonTextTransform transform, rpl::producer locked) { const auto result = Ui::CreateChild( parent.get(), rpl::single(QString()), - st); + st, + transform); const auto labelSt = result->lifetime().make_state( st::defaultFlatLabel); diff --git a/Telegram/SourceFiles/settings/sections/settings_premium.h b/Telegram/SourceFiles/settings/sections/settings_premium.h index 894e07c352..275234bb42 100644 --- a/Telegram/SourceFiles/settings/sections/settings_premium.h +++ b/Telegram/SourceFiles/settings/sections/settings_premium.h @@ -17,6 +17,10 @@ namespace style { struct RoundButton; } // namespace style +namespace Ui { +enum class RoundButtonTextTransform : uchar; +} // namespace Ui + namespace ChatHelpers { class Show; } // namespace ChatHelpers @@ -93,6 +97,7 @@ struct SubscribeButtonArgs final { not_null parent, rpl::producer text, const style::RoundButton &st, + Ui::RoundButtonTextTransform transform, rpl::producer locked); [[nodiscard]] not_null CreateSubscribeButton( diff --git a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp index c2d14bf90a..9a15348c94 100644 --- a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp +++ b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp @@ -3340,14 +3340,14 @@ void AddWithdrawalWidget( const auto button = Ui::CreateChild( buttonsContainer, rpl::never(), - stButton); + stButton, + Ui::RoundButtonTextToUpper); const auto buttonCredits = Ui::CreateChild( buttonsContainer, tr::lng_bot_earn_balance_button_buy_ads(), - stButton); - buttonCredits->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); + stButton, + Ui::RoundButtonTextNoTransform); { const auto icon = Ui::CreateChild(buttonCredits); const auto &st = st::msgBotKbUrlIcon; diff --git a/Telegram/SourceFiles/statistics/chart_widget.cpp b/Telegram/SourceFiles/statistics/chart_widget.cpp index 0c85b9f4a3..f66738036f 100644 --- a/Telegram/SourceFiles/statistics/chart_widget.cpp +++ b/Telegram/SourceFiles/statistics/chart_widget.cpp @@ -1319,13 +1319,12 @@ void ChartWidget::processLocalZoom(int xIndex) { const auto zoomOutButton = Ui::CreateChild( header, tr::lng_stats_zoom_out(), - st::statisticsHeaderButton); + st::statisticsHeaderButton, + Ui::RoundButtonTextNoTransform); zoomOutButton->moveToRight( 0, (header->height() - zoomOutButton->height()) / 2); zoomOutButton->show(); - zoomOutButton->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); zoomOutButton->setClickedCallback([=] { auto lifetime = _localZoomLifetime.make_state(); const auto animation = lifetime->make_state(); @@ -1533,9 +1532,8 @@ void ChartWidget::setZoomedChartData( const auto zoomOutButton = Ui::CreateChild( customHeader, tr::lng_stats_zoom_out(), - st::statisticsHeaderButton); - zoomOutButton->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); + st::statisticsHeaderButton, + Ui::RoundButtonTextNoTransform); zoomOutButton->moveToRight( 0, (customHeader->height() - zoomOutButton->height()) / 2); diff --git a/Telegram/SourceFiles/ui/boxes/collectible_info_box.cpp b/Telegram/SourceFiles/ui/boxes/collectible_info_box.cpp index 22ab7e05db..8cb102aa14 100644 --- a/Telegram/SourceFiles/ui/boxes/collectible_info_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/collectible_info_box.cpp @@ -230,9 +230,9 @@ void CollectibleInfoBox( object_ptr( box, tr::lng_collectible_learn_more(), - st::collectibleMore), + st::collectibleMore, + RoundButtonTextNoTransform), st::collectibleMorePadding); - more->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); more->setClickedCallback([url = info.url] { File::OpenUrl(url); }); @@ -243,9 +243,9 @@ void CollectibleInfoBox( auto owned = object_ptr( box, phrase(), - st::collectibleCopy); + st::collectibleCopy, + RoundButtonTextNoTransform); const auto copy = owned.data(); - copy->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); copy->setClickedCallback([copyCallback] { copyCallback(true); }); diff --git a/Telegram/SourceFiles/ui/boxes/confirm_phone_box.cpp b/Telegram/SourceFiles/ui/boxes/confirm_phone_box.cpp index ec309d5ea6..8b95730179 100644 --- a/Telegram/SourceFiles/ui/boxes/confirm_phone_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/confirm_phone_box.cpp @@ -32,10 +32,9 @@ ConfirmPhoneBox::ConfirmPhoneBox( _fragment.create( this, tr::lng_intro_fragment_button(), - st::fragmentBoxButton); + st::fragmentBoxButton, + RoundButtonTextNoTransform); _fragment->setClickedCallback([=] { File::OpenUrl(openUrl); }); - _fragment->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); } if (timeout) { _call.setStatus({ Ui::SentCodeCall::State::Waiting, *timeout }); diff --git a/Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp b/Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp index 1cb6d28242..3969f0a86c 100644 --- a/Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp @@ -386,7 +386,8 @@ void AddStakePresets( const auto button = CreateChild( wrap, rpl::single(FormatTonAmount(nanoTon).full + diamond), - st::stakePresetButton); + st::stakePresetButton, + RoundButtonTextToUpper); button->setClickedCallback([=] { callback(nanoTon); }); diff --git a/Telegram/SourceFiles/ui/boxes/show_or_premium_box.cpp b/Telegram/SourceFiles/ui/boxes/show_or_premium_box.cpp index 0cc7c8faeb..c2cb37d0d5 100644 --- a/Telegram/SourceFiles/ui/boxes/show_or_premium_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/show_or_premium_box.cpp @@ -157,9 +157,9 @@ void ShowOrPremiumBox( object_ptr( box, std::move(skin.showButton), - st::showOrShowButton), + st::showOrShowButton, + RoundButtonTextNoTransform), buttonPadding); - show->setTextTransform(RoundButton::TextTransform::NoTransform); box->addRow( MakeShowOrLabel(box, std::move(skin.orPremium)), st::showOrLabelPadding + buttonPadding, diff --git a/Telegram/SourceFiles/ui/chat/choose_theme_controller.cpp b/Telegram/SourceFiles/ui/chat/choose_theme_controller.cpp index 3a0924e134..8cbb19fc1f 100644 --- a/Telegram/SourceFiles/ui/chat/choose_theme_controller.cpp +++ b/Telegram/SourceFiles/ui/chat/choose_theme_controller.cpp @@ -291,13 +291,13 @@ void ChooseThemeController::initButtons() { const auto apply = CreateChild( controls, tr::lng_chat_theme_apply(), - st::defaultLightButton); - apply->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::defaultLightButton, + RoundButtonTextNoTransform); const auto choose = CreateChild( controls, tr::lng_chat_theme_change_wallpaper(), - st::defaultLightButton); - choose->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + st::defaultLightButton, + RoundButtonTextNoTransform); const auto &margin = st::chatThemeButtonMargin; controls->resize( diff --git a/Telegram/SourceFiles/ui/chat/group_call_bar.cpp b/Telegram/SourceFiles/ui/chat/group_call_bar.cpp index d8740e3be6..3adb8cd65a 100644 --- a/Telegram/SourceFiles/ui/chat/group_call_bar.cpp +++ b/Telegram/SourceFiles/ui/chat/group_call_bar.cpp @@ -190,8 +190,8 @@ void GroupCallBar::refreshScheduledProcess() { _join = std::make_unique( _inner.get(), tr::lng_group_call_join(), - st::groupCallTopBarJoin); - _join->setTextTransform(RoundButton::TextTransform::NoTransform); + st::groupCallTopBarJoin, + RoundButtonTextNoTransform); setupRightButton(_join.get()); } } else if (!_scheduledProcess) { @@ -200,7 +200,8 @@ void GroupCallBar::refreshScheduledProcess() { _open = std::make_unique( _inner.get(), _scheduledProcess->text(GroupCallScheduledLeft::Negative::Show), - st::groupCallTopBarOpen); + st::groupCallTopBarOpen, + RoundButtonTextToUpper); setupRightButton(_open.get()); _open->widthValue( ) | rpl::on_next([=] { diff --git a/Telegram/SourceFiles/ui/controls/filter_link_header.cpp b/Telegram/SourceFiles/ui/controls/filter_link_header.cpp index e525783116..11af7d696a 100644 --- a/Telegram/SourceFiles/ui/controls/filter_link_header.cpp +++ b/Telegram/SourceFiles/ui/controls/filter_link_header.cpp @@ -494,7 +494,7 @@ object_ptr FilterLinkProcessButton( rpl::producer badge) { const auto st = &st::filterInviteBox.button; const auto badgeSt = &st::filterInviteButtonBadgeStyle; - auto result = object_ptr(parent, rpl::single(u""_q), *st); + auto result = object_ptr(parent, rpl::single(u""_q), *st, RoundButtonTextToUpper); struct Data { TextWithEntities text; diff --git a/Telegram/SourceFiles/ui/controls/invite_link_buttons.cpp b/Telegram/SourceFiles/ui/controls/invite_link_buttons.cpp index 83da0bc972..e000e65614 100644 --- a/Telegram/SourceFiles/ui/controls/invite_link_buttons.cpp +++ b/Telegram/SourceFiles/ui/controls/invite_link_buttons.cpp @@ -41,14 +41,14 @@ void AddCopyShareLinkButtons( const auto copy = CreateChild( wrap, tr::lng_group_invite_copy(), - st::inviteLinkCopy); - copy->setTextTransform(RoundButton::TextTransform::NoTransform); + st::inviteLinkCopy, + RoundButtonTextNoTransform); copy->setClickedCallback(copyLink); const auto share = CreateChild( wrap, tr::lng_group_invite_share(), - st::inviteLinkShare); - share->setTextTransform(RoundButton::TextTransform::NoTransform); + st::inviteLinkShare, + RoundButtonTextNoTransform); share->setClickedCallback(shareLink); wrap->widthValue( @@ -69,9 +69,9 @@ void AddReactivateLinkButton( object_ptr( container, tr::lng_group_invite_reactivate(), - st::inviteLinkReactivate), + st::inviteLinkReactivate, + RoundButtonTextNoTransform), st::inviteLinkButtonsPadding); - button->setTextTransform(RoundButton::TextTransform::NoTransform); button->setClickedCallback(editLink); } @@ -82,9 +82,9 @@ void AddDeleteLinkButton( object_ptr( container, tr::lng_group_invite_delete(), - st::inviteLinkDelete), + st::inviteLinkDelete, + RoundButtonTextNoTransform), st::inviteLinkButtonsPadding); - button->setTextTransform(RoundButton::TextTransform::NoTransform); button->setClickedCallback(deleteLink); } diff --git a/Telegram/SourceFiles/ui/controls/location_picker.cpp b/Telegram/SourceFiles/ui/controls/location_picker.cpp index 0bd6ffbbc7..0c0d3284c8 100644 --- a/Telegram/SourceFiles/ui/controls/location_picker.cpp +++ b/Telegram/SourceFiles/ui/controls/location_picker.cpp @@ -686,9 +686,9 @@ not_null SetupMapPlaceholder( const auto button = CreateChild( result, tr::lng_maps_select_on_map(), - st::pickLocationChooseOnMap); + st::pickLocationChooseOnMap, + RoundButtonTextNoTransform); button->setFullRadius(true); - button->setTextTransform(RoundButton::TextTransform::NoTransform); button->setClickedCallback(choose); parent->sizeValue() | rpl::on_next([=](QSize size) { diff --git a/Telegram/SourceFiles/ui/controls/table_rows.cpp b/Telegram/SourceFiles/ui/controls/table_rows.cpp index 78054e3020..6535c2e775 100644 --- a/Telegram/SourceFiles/ui/controls/table_rows.cpp +++ b/Telegram/SourceFiles/ui/controls/table_rows.cpp @@ -109,8 +109,8 @@ ValueWithSmallButton MakeValueWithSmallButton( const auto button = CreateChild( raw, std::move(buttonText), - table->st().smallButton); - button->setTextTransform(RoundButton::TextTransform::NoTransform); + table->st().smallButton, + RoundButtonTextNoTransform); if (handler) { button->setClickedCallback([button, handler = std::move(handler)] { handler(button); diff --git a/Telegram/SourceFiles/window/notifications_manager_default.cpp b/Telegram/SourceFiles/window/notifications_manager_default.cpp index adddbb7041..eb1b8f2e4a 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.cpp +++ b/Telegram/SourceFiles/window/notifications_manager_default.cpp @@ -660,7 +660,7 @@ Notification::Notification( , _forwardedCount(forwardedCount) , _fromScheduled(fromScheduled) , _close(this, st::notifyClose) -, _reply(this, tr::lng_notification_reply(), st::defaultBoxButton) { +, _reply(this, tr::lng_notification_reply(), st::defaultBoxButton, Ui::RoundButtonTextToUpper) { Lang::Updated( ) | rpl::on_next([=] { refreshLang(); diff --git a/Telegram/SourceFiles/window/themes/window_theme_warning.cpp b/Telegram/SourceFiles/window/themes/window_theme_warning.cpp index bb53332f7f..1549453027 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_warning.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_warning.cpp @@ -29,12 +29,9 @@ WarningWidget::WarningWidget(QWidget *parent) : RpWidget(parent) , _timer([=] { handleTimer(); }) , _secondsLeft(kWaitBeforeRevertMs / 1000) -, _keepChanges(this, tr::lng_theme_keep_changes(), st::defaultBoxButton) -, _revert(this, tr::lng_theme_revert(), st::defaultBoxButton) { - using TextTransform = Ui::RoundButton::TextTransform; - _keepChanges->setTextTransform(TextTransform::NoTransform); +, _keepChanges(this, tr::lng_theme_keep_changes(), st::defaultBoxButton, Ui::RoundButtonTextNoTransform) +, _revert(this, tr::lng_theme_revert(), st::defaultBoxButton, Ui::RoundButtonTextNoTransform) { _keepChanges->setClickedCallback([] { KeepApplied(); }); - _revert->setTextTransform(TextTransform::NoTransform); _revert->setClickedCallback([] { Revert(); }); updateText(); } diff --git a/Telegram/SourceFiles/window/window_lock_widgets.cpp b/Telegram/SourceFiles/window/window_lock_widgets.cpp index 13160a7763..bf7b9b5118 100644 --- a/Telegram/SourceFiles/window/window_lock_widgets.cpp +++ b/Telegram/SourceFiles/window/window_lock_widgets.cpp @@ -98,12 +98,10 @@ PasscodeLockWidget::PasscodeLockWidget( not_null window) : LockWidget(parent, window) , _passcode(this, st::passcodeInput, tr::lng_passcode_ph()) -, _submit(this, tr::lng_passcode_submit(), st::passcodeSubmit) +, _submit(this, tr::lng_passcode_submit(), st::passcodeSubmit, Ui::RoundButtonTextNoTransform) , _logout(this, tr::lng_passcode_logout(tr::now)) { connect(_passcode, &Ui::MaskedInputField::changed, [=] { changed(); }); connect(_passcode, &Ui::MaskedInputField::submitted, [=] { submit(); }); - - _submit->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); _submit->setClickedCallback([=] { submit(); }); _logout->setClickedCallback([=] { window->showLogoutConfirmation(); diff --git a/Telegram/SourceFiles/window/window_setup_email.cpp b/Telegram/SourceFiles/window/window_setup_email.cpp index f7f7b2ec84..877a94e0bf 100644 --- a/Telegram/SourceFiles/window/window_setup_email.cpp +++ b/Telegram/SourceFiles/window/window_setup_email.cpp @@ -125,9 +125,8 @@ SetupEmailLockWidget::SetupEmailLockWidget( _logoutButton = object_ptr( this, tr::lng_settings_logout(), - st::defaultBoxButton); - _logoutButton->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); + st::defaultBoxButton, + Ui::RoundButtonTextNoTransform); if (session) { session->promoSuggestions().setSetupEmailState( Data::SetupEmailState::SettingUpNoSkip); @@ -151,9 +150,8 @@ SetupEmailLockWidget::SetupEmailLockWidget( _debugButton = object_ptr( this, rpl::single(u"[DEBUG] Clear bio"_q), - st::defaultBoxButton); - _debugButton->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); + st::defaultBoxButton, + Ui::RoundButtonTextNoTransform); _debugButton->setClickedCallback([=] { session->api().saveSelfBio({}); }); @@ -227,11 +225,10 @@ SetupEmailLockWidget::SetupEmailLockWidget( object_ptr( _layout, tr::lng_settings_cloud_login_email_confirm(), - st::changePhoneButton), + st::changePhoneButton, + Ui::RoundButtonTextNoTransform), st::boxRowPadding, style::al_top); - submit->setTextTransform( - Ui::RoundButton::TextTransform::NoTransform); _emailInput = emailInput; _errorLabel = errorLabel; diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 801ce21201..d43113e6bb 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 801ce2120114011d59c9da72fe9751b4b1d182d5 +Subproject commit d43113e6bb3508a97154ffebc3c1744fdfd2a6a3 From 494833236fbafcb6831d541be4a53f9ce69e0055 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 16:23:24 +0300 Subject: [PATCH 39/50] Defaulted RoundButton text transform to no-transform. --- Telegram/SourceFiles/boxes/about_box.cpp | 3 +-- Telegram/SourceFiles/boxes/about_sponsored_box.cpp | 3 +-- .../SourceFiles/boxes/background_preview_box.cpp | 7 ++----- Telegram/SourceFiles/boxes/local_storage_box.cpp | 2 +- .../SourceFiles/boxes/select_future_owner_box.cpp | 12 ++++-------- Telegram/SourceFiles/boxes/star_gift_auction_box.cpp | 3 +-- Telegram/SourceFiles/boxes/star_gift_preview_box.cpp | 3 +-- Telegram/SourceFiles/boxes/url_auth_box_content.cpp | 12 ++++-------- .../SourceFiles/calls/group/calls_group_rtmp.cpp | 3 +-- .../chat_helpers/ttl_media_layer_widget.cpp | 3 +-- .../SourceFiles/dialogs/dialogs_inner_widget.cpp | 3 +-- .../ui/dialogs_top_bar_suggestion_content.cpp | 12 ++++-------- .../SourceFiles/dialogs/ui/posts_search_intro.cpp | 3 +-- .../SourceFiles/export/view/export_view_progress.cpp | 6 ++---- .../SourceFiles/export/view/export_view_settings.cpp | 6 ++---- Telegram/SourceFiles/history/history_widget.cpp | 3 +-- .../view/controls/history_view_compose_controls.cpp | 3 +-- .../history/view/history_view_contact_status.cpp | 3 +-- .../history/view/history_view_pinned_bar.cpp | 3 +-- .../history/view/history_view_scheduled_section.cpp | 3 +-- .../history/view/history_view_sticker_toast.cpp | 3 +-- .../history/view/history_view_translate_bar.cpp | 3 +-- .../boosts/create_giveaway_box.cpp | 3 +-- .../boosts/info_boosts_inner_widget.cpp | 6 ++---- .../earn/info_channel_earn_list.cpp | 3 +-- .../info/peer_gifts/info_peer_gifts_widget.cpp | 6 ++---- .../info/polls/info_polls_list_widget.cpp | 3 +-- .../info/profile/info_profile_actions.cpp | 6 ++---- .../info/profile/info_profile_top_bar.cpp | 6 ++---- .../info/similar_peers/info_similar_peers_widget.cpp | 4 ++-- .../info/stories/info_stories_inner_widget.cpp | 3 +-- .../SourceFiles/info/stories/info_stories_widget.cpp | 3 +-- .../info/userpic/info_userpic_emoji_builder.cpp | 3 +-- .../SourceFiles/inline_bots/inline_results_inner.cpp | 2 +- Telegram/SourceFiles/intro/intro_widget.cpp | 4 ++-- Telegram/SourceFiles/iv/iv_controller.cpp | 3 +-- .../media/stories/media_stories_controller.cpp | 3 +-- .../media/view/media_view_overlay_widget.cpp | 12 ++++-------- .../media/view/media_view_playback_sponsored.cpp | 3 +-- .../passport/passport_panel_edit_contact.cpp | 3 +-- .../SourceFiles/passport/passport_panel_password.cpp | 6 ++---- .../payments/ui/payments_form_summary.cpp | 9 +++------ .../settings_cloud_password_common.cpp | 3 +-- .../settings/sections/settings_credits.cpp | 3 +-- .../settings/sections/settings_folders.cpp | 5 ++--- .../settings/sections/settings_local_passcode.cpp | 3 +-- .../SourceFiles/settings/sections/settings_main.cpp | 12 ++++-------- .../settings/sections/settings_passkeys.cpp | 3 +-- .../settings/sections/settings_premium.cpp | 4 ++-- .../SourceFiles/settings/sections/settings_premium.h | 4 ++-- .../settings/settings_credits_graphics.cpp | 3 +-- Telegram/SourceFiles/statistics/chart_widget.cpp | 6 ++---- .../SourceFiles/ui/boxes/collectible_info_box.cpp | 6 ++---- Telegram/SourceFiles/ui/boxes/confirm_phone_box.cpp | 3 +-- .../SourceFiles/ui/boxes/show_or_premium_box.cpp | 3 +-- .../SourceFiles/ui/chat/choose_theme_controller.cpp | 6 ++---- Telegram/SourceFiles/ui/chat/group_call_bar.cpp | 3 +-- .../SourceFiles/ui/controls/invite_link_buttons.cpp | 12 ++++-------- Telegram/SourceFiles/ui/controls/location_picker.cpp | 3 +-- Telegram/SourceFiles/ui/controls/table_rows.cpp | 3 +-- .../window/themes/window_theme_warning.cpp | 4 ++-- Telegram/SourceFiles/window/window_lock_widgets.cpp | 2 +- Telegram/SourceFiles/window/window_setup_email.cpp | 9 +++------ Telegram/lib_ui | 2 +- 64 files changed, 103 insertions(+), 192 deletions(-) diff --git a/Telegram/SourceFiles/boxes/about_box.cpp b/Telegram/SourceFiles/boxes/about_box.cpp index a40f7f6346..738ad20837 100644 --- a/Telegram/SourceFiles/boxes/about_box.cpp +++ b/Telegram/SourceFiles/boxes/about_box.cpp @@ -302,8 +302,7 @@ void ArchiveHintBox( auto button = object_ptr( box, tr::lng_archive_hint_button(), - st::defaultActiveButton, - Ui::RoundButtonTextNoTransform); + st::defaultActiveButton); button->resizeToWidth(box->width() - st.buttonPadding.left() - st.buttonPadding.left()); diff --git a/Telegram/SourceFiles/boxes/about_sponsored_box.cpp b/Telegram/SourceFiles/boxes/about_sponsored_box.cpp index 113217a177..e4af2b8a1a 100644 --- a/Telegram/SourceFiles/boxes/about_sponsored_box.cpp +++ b/Telegram/SourceFiles/boxes/about_sponsored_box.cpp @@ -35,8 +35,7 @@ void AboutSponsoredBox(not_null box) { const auto button = Ui::CreateChild( row, rpl::single(kUrl.utf8()), - st, - RoundButtonTextNoTransform); + st); button->setBrushOverride(Qt::NoBrush); button->setPenOverride(QPen(st::historyLinkInFg)); rpl::combine( diff --git a/Telegram/SourceFiles/boxes/background_preview_box.cpp b/Telegram/SourceFiles/boxes/background_preview_box.cpp index 6a95ecfb28..dd07ffd5e7 100644 --- a/Telegram/SourceFiles/boxes/background_preview_box.cpp +++ b/Telegram/SourceFiles/boxes/background_preview_box.cpp @@ -758,8 +758,7 @@ void BackgroundPreviewBox::applyForPeer() { const auto forMe = CreateChild( overlay, tr::lng_background_apply_me(), - st::backgroundConfirm, - RoundButtonTextNoTransform); + st::backgroundConfirm); forMe->setClickedCallback([=] { applyForPeer(false); }); @@ -770,7 +769,6 @@ void BackgroundPreviewBox::applyForPeer() { lt_user, rpl::single(_forPeer->shortName())), st::backgroundConfirm, - RoundButtonTextNoTransform, Data::AmPremiumValue(&_forPeer->session()) | rpl::map(!_1)); forBoth->setClickedCallback([=] { if (_forPeer->session().premium()) { @@ -784,8 +782,7 @@ void BackgroundPreviewBox::applyForPeer() { const auto cancel = CreateChild( overlay, tr::lng_cancel(), - st::backgroundConfirmCancel, - RoundButtonTextNoTransform); + st::backgroundConfirmCancel); cancel->setClickedCallback([=] { const auto raw = _forBothOverlay.release(); raw->shownValue() | rpl::filter( diff --git a/Telegram/SourceFiles/boxes/local_storage_box.cpp b/Telegram/SourceFiles/boxes/local_storage_box.cpp index 1bdac1a7f0..cf1fdc0456 100644 --- a/Telegram/SourceFiles/boxes/local_storage_box.cpp +++ b/Telegram/SourceFiles/boxes/local_storage_box.cpp @@ -168,7 +168,7 @@ LocalStorageBox::Row::Row( this, sizeText(data), st::localStorageRowSize) -, _clear(this, std::move(clear), st::localStorageClear, Ui::RoundButtonTextNoTransform) { +, _clear(this, std::move(clear), st::localStorageClear) { _clear->setVisible(data.count != 0); } diff --git a/Telegram/SourceFiles/boxes/select_future_owner_box.cpp b/Telegram/SourceFiles/boxes/select_future_owner_box.cpp index fc138160af..6b7967ad4f 100644 --- a/Telegram/SourceFiles/boxes/select_future_owner_box.cpp +++ b/Telegram/SourceFiles/boxes/select_future_owner_box.cpp @@ -321,8 +321,7 @@ void SelectFutureOwnerbox( !adminsAreEqual ? tr::lng_select_next_owner_box() : tr::lng_select_next_owner_box_admin(), - st::defaultLightButton, - Ui::RoundButtonTextNoTransform), + st::defaultLightButton), st::boxRowPadding, style::al_justify); Ui::AddSkip(content); @@ -330,8 +329,7 @@ void SelectFutureOwnerbox( object_ptr( content, tr::lng_cancel(), - st::defaultLightButton, - Ui::RoundButtonTextNoTransform), + st::defaultLightButton), st::boxRowPadding, style::al_justify); cancel->setClickedCallback([=] { @@ -344,8 +342,7 @@ void SelectFutureOwnerbox( isGroup ? tr::lng_profile_leave_group() : tr::lng_profile_leave_channel(), - st::attentionBoxButton, - Ui::RoundButtonTextNoTransform), + st::attentionBoxButton), st::boxRowPadding, style::al_justify); leave->setClickedCallback([=, revoke = false] { @@ -479,8 +476,7 @@ void SelectFutureOwnerbox( }), tr::lng_select_next_owner_box_confirm(), tr::lng_close()), - st::defaultActiveButton, - Ui::RoundButtonTextNoTransform); + st::defaultActiveButton); const auto raw = button.data(); rpl::combine( state->selectionChanges.events() | rpl::map_to(0), diff --git a/Telegram/SourceFiles/boxes/star_gift_auction_box.cpp b/Telegram/SourceFiles/boxes/star_gift_auction_box.cpp index 4dc7935847..312b75351b 100644 --- a/Telegram/SourceFiles/boxes/star_gift_auction_box.cpp +++ b/Telegram/SourceFiles/boxes/star_gift_auction_box.cpp @@ -1983,8 +1983,7 @@ object_ptr MakeActiveAuctionRow( object_ptr( raw, rpl::single(QString()), - st::auctionListRaise, - RoundButtonTextNoTransform), + st::auctionListRaise), st::auctionListRaisePadding); auto secondsLeft = rpl::duplicate( diff --git a/Telegram/SourceFiles/boxes/star_gift_preview_box.cpp b/Telegram/SourceFiles/boxes/star_gift_preview_box.cpp index 3ab7a4a414..72ac5b9d32 100644 --- a/Telegram/SourceFiles/boxes/star_gift_preview_box.cpp +++ b/Telegram/SourceFiles/boxes/star_gift_preview_box.cpp @@ -1559,8 +1559,7 @@ void StarGiftPreviewBox( auto owned = object_ptr( buttonsParent, text(), - st, - RoundButtonTextNoTransform); + st); const auto raw = owned.data(); raw->setClickedCallback([=] { diff --git a/Telegram/SourceFiles/boxes/url_auth_box_content.cpp b/Telegram/SourceFiles/boxes/url_auth_box_content.cpp index 232751aff1..726d7ceaef 100644 --- a/Telegram/SourceFiles/boxes/url_auth_box_content.cpp +++ b/Telegram/SourceFiles/boxes/url_auth_box_content.cpp @@ -82,8 +82,7 @@ void ShowMatchCodesBox( const auto button = Ui::CreateChild( buttons, rpl::single(emojiCode ? QString() : code), - st::urlAuthCodesButton, - Ui::RoundButtonTextNoTransform); + st::urlAuthCodesButton); if (emojiCode) { button->setTextFgOverride(QColor(Qt::transparent)); const auto overlay = Ui::CreateChild(button); @@ -200,8 +199,7 @@ void ShowMatchCodesBox( object_ptr( content, tr::lng_cancel(), - st::attentionBoxButton, - Ui::RoundButtonTextNoTransform), + st::attentionBoxButton), padding); PrepareFullWidthRoundButton(button, content, padding); button->setClickedCallback([=] { @@ -550,8 +548,7 @@ void ShowDetails( object_ptr( content, tr::lng_url_auth_login_button(), - st::defaultLightButton, - Ui::RoundButtonTextNoTransform), + st::defaultLightButton), padding); PrepareFullWidthRoundButton(button, content, padding); button->setClickedCallback([=] { @@ -588,8 +585,7 @@ void ShowDetails( object_ptr( content, tr::lng_suggest_action_decline(), - st::attentionBoxButton, - Ui::RoundButtonTextNoTransform), + st::attentionBoxButton), padding); PrepareFullWidthRoundButton(button, content, padding); button->setClickedCallback([=] { diff --git a/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp b/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp index c5e9c7c165..7fd579b465 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp @@ -257,8 +257,7 @@ void StartRtmpProcess::FillRtmpRows( auto button = Ui::CreateChild( wrap.data(), rpl::duplicate(text), - st::groupCallRtmpCopyButton, - Ui::RoundButtonTextNoTransform); + st::groupCallRtmpCopyButton); button->setClickedCallback(key ? Fn([=] { QGuiApplication::clipboard()->setText(state->key.current()); diff --git a/Telegram/SourceFiles/chat_helpers/ttl_media_layer_widget.cpp b/Telegram/SourceFiles/chat_helpers/ttl_media_layer_widget.cpp index f0b0aa23b0..919c360ec1 100644 --- a/Telegram/SourceFiles/chat_helpers/ttl_media_layer_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/ttl_media_layer_widget.cpp @@ -198,8 +198,7 @@ PreviewWrap::PreviewWrap( item->out() ? tr::lng_close() : tr::lng_ttl_voice_close_in(), - st::ttlMediaButton, - Ui::RoundButtonTextNoTransform); + st::ttlMediaButton); close->setFullRadius(true); close->setClickedCallback(closeCallback); diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index 98b6f5095b..cbcc309442 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -4333,8 +4333,7 @@ void InnerWidget::refreshEmpty() { _emptyButton.create( this, tr::lng_no_conversations_button(), - st::dialogEmptyButton, - Ui::RoundButtonTextNoTransform); + st::dialogEmptyButton); _emptyButton->setVisible(isListVisible); _emptyButton->setClickedCallback([=, window = _controller] { window->show(PrepareContactsBox(window)); diff --git a/Telegram/SourceFiles/dialogs/ui/dialogs_top_bar_suggestion_content.cpp b/Telegram/SourceFiles/dialogs/ui/dialogs_top_bar_suggestion_content.cpp index 89bfd36bd0..97e368a451 100644 --- a/Telegram/SourceFiles/dialogs/ui/dialogs_top_bar_suggestion_content.cpp +++ b/Telegram/SourceFiles/dialogs/ui/dialogs_top_bar_suggestion_content.cpp @@ -126,13 +126,11 @@ not_null*> CreateUnconfirmedAuthContent( const auto yes = Ui::CreateChild( buttons, tr::lng_unconfirmed_auth_confirm(), - st::dialogsUnconfirmedAuthButton, - Ui::RoundButtonTextNoTransform); + st::dialogsUnconfirmedAuthButton); const auto no = Ui::CreateChild( buttons, tr::lng_unconfirmed_auth_deny(), - st::dialogsUnconfirmedAuthButtonNo, - Ui::RoundButtonTextNoTransform); + st::dialogsUnconfirmedAuthButtonNo); yes->setClickedCallback([=] { wrap->toggle(false, anim::type::normal); base::call_delayed(st::universalDuration, wrap, [=] { @@ -237,8 +235,7 @@ void ShowAuthDeniedBox( object_ptr( box, rpl::single(QString()), - st::defaultActiveButton, - Ui::RoundButtonTextNoTransform)); + st::defaultActiveButton)); confirm->setClickedCallback([=] { box->closeBox(); }); @@ -363,8 +360,7 @@ void TopBarSuggestionContent::setRightButton( _rightButton = base::make_unique_q( this, rpl::single(QString()), - st::dialogsTopBarRightButton, - RoundButtonTextNoTransform); + st::dialogsTopBarRightButton); _rightButton->setText(std::move(text)); rpl::combine( sizeValue(), diff --git a/Telegram/SourceFiles/dialogs/ui/posts_search_intro.cpp b/Telegram/SourceFiles/dialogs/ui/posts_search_intro.cpp index c3a6362bd3..d21aea9c00 100644 --- a/Telegram/SourceFiles/dialogs/ui/posts_search_intro.cpp +++ b/Telegram/SourceFiles/dialogs/ui/posts_search_intro.cpp @@ -185,8 +185,7 @@ void PostsSearchIntro::setup() { object_ptr( _content.get(), rpl::single(QString()), - st::postsSearchIntroButton, - Ui::RoundButtonTextNoTransform), + st::postsSearchIntroButton), style::al_top); _footer = _content->add( object_ptr( diff --git a/Telegram/SourceFiles/export/view/export_view_progress.cpp b/Telegram/SourceFiles/export/view/export_view_progress.cpp index bec4905c5e..9ffcbe2fd4 100644 --- a/Telegram/SourceFiles/export/view/export_view_progress.cpp +++ b/Telegram/SourceFiles/export/view/export_view_progress.cpp @@ -277,8 +277,7 @@ ProgressWidget::ProgressWidget( _cancel = base::make_unique_q( this, tr::lng_export_stop(), - st::exportCancelButton, - Ui::RoundButtonTextNoTransform); + st::exportCancelButton); setupBottomButton(_cancel.get()); } @@ -361,8 +360,7 @@ void ProgressWidget::showDone() { _done = base::make_unique_q( this, tr::lng_export_done(), - st::exportDoneButton, - Ui::RoundButtonTextNoTransform); + st::exportDoneButton); const auto desired = std::min( st::exportDoneButton.style.font->width(tr::lng_export_done(tr::now)) + st::exportDoneButton.height diff --git a/Telegram/SourceFiles/export/view/export_view_settings.cpp b/Telegram/SourceFiles/export/view/export_view_settings.cpp index 26aa8be841..1964ff00f0 100644 --- a/Telegram/SourceFiles/export/view/export_view_settings.cpp +++ b/Telegram/SourceFiles/export/view/export_view_settings.cpp @@ -885,8 +885,7 @@ void SettingsWidget::refreshButtons( ? Ui::CreateChild( container.get(), tr::lng_export_start(), - st::defaultBoxButton, - Ui::RoundButtonTextNoTransform) + st::defaultBoxButton) : nullptr; if (start) { start->show(); @@ -903,8 +902,7 @@ void SettingsWidget::refreshButtons( const auto cancel = Ui::CreateChild( container.get(), tr::lng_cancel(), - st::defaultBoxButton, - Ui::RoundButtonTextNoTransform); + st::defaultBoxButton); cancel->show(); _cancelClicks = cancel->clicks() | rpl::to_empty; diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 14c11d5c9d..9b5e34dc77 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -5878,8 +5878,7 @@ bool HistoryWidget::updateCmdStartShown() { (_botMenu.text.isEmpty() ? tr::lng_bot_menu_button() : rpl::single(_botMenu.text)), - st::historyBotMenuButton, - Ui::RoundButtonTextNoTransform); + st::historyBotMenuButton); orderWidgets(); _botMenu.button->setFullRadius(true); diff --git a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp index 35009d8035..8780c92df8 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp @@ -3074,8 +3074,7 @@ void SetupRestrictionView( auto unlock = std::make_unique( widget, rpl::single(text), - st->premiumRequired.button, - RoundButtonTextNoTransform); + st->premiumRequired.button); unlock->show(); unlock->setAttribute(Qt::WA_TransparentForMouseEvents); unlock->setFullRadius(true); diff --git a/Telegram/SourceFiles/history/view/history_view_contact_status.cpp b/Telegram/SourceFiles/history/view/history_view_contact_status.cpp index e2a0f1e9be..f3c826f09d 100644 --- a/Telegram/SourceFiles/history/view/history_view_contact_status.cpp +++ b/Telegram/SourceFiles/history/view/history_view_contact_status.cpp @@ -1014,8 +1014,7 @@ BusinessBotStatus::Bar::Bar(QWidget *parent) , _togglePaused( this, rpl::single(QString()), - st::historyBusinessBotToggle, - Ui::RoundButtonTextNoTransform) + st::historyBusinessBotToggle) , _settings(this, st::historyBusinessBotSettings) { _name->setAttribute(Qt::WA_TransparentForMouseEvents); _status->setAttribute(Qt::WA_TransparentForMouseEvents); diff --git a/Telegram/SourceFiles/history/view/history_view_pinned_bar.cpp b/Telegram/SourceFiles/history/view/history_view_pinned_bar.cpp index cb514f6ffa..5ac0728691 100644 --- a/Telegram/SourceFiles/history/view/history_view_pinned_bar.cpp +++ b/Telegram/SourceFiles/history/view/history_view_pinned_bar.cpp @@ -170,8 +170,7 @@ auto WithPinnedTitle(not_null session, PinnedId id) { auto button = object_ptr( parent, rpl::never(), // Text is handled by the inner label. - stButton, - Ui::RoundButtonTextNoTransform); + stButton); const auto label = Ui::CreateChild( button.data(), diff --git a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp index caffea103f..bf1d2721e8 100644 --- a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp @@ -1741,8 +1741,7 @@ bool ShowScheduledVideoPublished( const auto button = Ui::CreateChild( widget.get(), rpl::single(view), - st::processingVideoView, - Ui::RoundButtonTextNoTransform); + st::processingVideoView); button->show(); rpl::combine( widget->sizeValue(), diff --git a/Telegram/SourceFiles/history/view/history_view_sticker_toast.cpp b/Telegram/SourceFiles/history/view/history_view_sticker_toast.cpp index 94131da727..68446736c5 100644 --- a/Telegram/SourceFiles/history/view/history_view_sticker_toast.cpp +++ b/Telegram/SourceFiles/history/view/history_view_sticker_toast.cpp @@ -201,8 +201,7 @@ void StickerToast::showWithTitle(const QString &title) { const auto button = Ui::CreateChild( widget.get(), rpl::single(view), - st::historyPremiumViewSet, - Ui::RoundButtonTextNoTransform); + st::historyPremiumViewSet); button->show(); rpl::combine( widget->sizeValue(), diff --git a/Telegram/SourceFiles/history/view/history_view_translate_bar.cpp b/Telegram/SourceFiles/history/view/history_view_translate_bar.cpp index e117aa12e6..349065bdc6 100644 --- a/Telegram/SourceFiles/history/view/history_view_translate_bar.cpp +++ b/Telegram/SourceFiles/history/view/history_view_translate_bar.cpp @@ -599,8 +599,7 @@ void TranslateBar::showToast( const auto button = Ui::CreateChild( widget.get(), rpl::single(buttonText), - st::historyPremiumViewSet, - Ui::RoundButtonTextNoTransform); + st::historyPremiumViewSet); button->show(); rpl::combine( widget->sizeValue(), diff --git a/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp b/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp index 091f717cc1..df14f19bbd 100644 --- a/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp +++ b/Telegram/SourceFiles/info/channel_statistics/boosts/create_giveaway_box.cpp @@ -1344,8 +1344,7 @@ void CreateGiveawayBox( auto button = object_ptr( box, rpl::never(), - st::giveawayGiftCodeStartButton, - Ui::RoundButtonTextNoTransform); + st::giveawayGiftCodeStartButton); AddLabelWithBadgeToButton( button, diff --git a/Telegram/SourceFiles/info/channel_statistics/boosts/info_boosts_inner_widget.cpp b/Telegram/SourceFiles/info/channel_statistics/boosts/info_boosts_inner_widget.cpp index cf8e330635..0475266629 100644 --- a/Telegram/SourceFiles/info/channel_statistics/boosts/info_boosts_inner_widget.cpp +++ b/Telegram/SourceFiles/info/channel_statistics/boosts/info_boosts_inner_widget.cpp @@ -202,14 +202,12 @@ void FillShareLink( const auto copy = CreateChild( wrap, tr::lng_group_invite_context_copy(), - st::inviteLinkCopy, - Ui::RoundButtonTextNoTransform); + st::inviteLinkCopy); copy->setClickedCallback(copyLink); const auto share = CreateChild( wrap, tr::lng_group_invite_context_share(), - st::inviteLinkShare, - Ui::RoundButtonTextNoTransform); + st::inviteLinkShare); share->setClickedCallback(shareLink); wrap->widthValue( diff --git a/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp b/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp index eda9510d4f..84a3b86eb6 100644 --- a/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp +++ b/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp @@ -594,8 +594,7 @@ void InnerWidget::fill() { auto button = object_ptr( container, tr::lng_channel_earn_learn_close(), - st::defaultActiveButton, - Ui::RoundButtonTextNoTransform); + st::defaultActiveButton); button->resizeToWidth(box->width() - st.buttonPadding.left() - st.buttonPadding.left()); diff --git a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp index 38512b4905..37c790ccd8 100644 --- a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp +++ b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp @@ -1305,8 +1305,7 @@ void InnerWidget::refreshAbout() { object_ptr( about.get(), rpl::single(QString()), - st::collectionEmptyButton, - Ui::RoundButtonTextNoTransform), + st::collectionEmptyButton), st::collectionEmptyAddMargin, style::al_top); button->setText(tr::lng_gift_collection_add_button( @@ -2495,8 +2494,7 @@ void Widget::setupBottomButton(int wasBottomHeight) { const auto button = Ui::CreateChild( bottom, rpl::single(QString()), - st::collectionEditBox.button, - Ui::RoundButtonTextNoTransform); + st::collectionEditBox.button); button->setText(tr::lng_gift_collection_add_button( ) | rpl::map([](const QString &text) { return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text); diff --git a/Telegram/SourceFiles/info/polls/info_polls_list_widget.cpp b/Telegram/SourceFiles/info/polls/info_polls_list_widget.cpp index 67d56caf45..0c848e506f 100644 --- a/Telegram/SourceFiles/info/polls/info_polls_list_widget.cpp +++ b/Telegram/SourceFiles/info/polls/info_polls_list_widget.cpp @@ -269,8 +269,7 @@ void ListWidget::Inner::setupHistory() { _newPollButton.create( _scroll.get(), tr::lng_polls_create_title(), - st::defaultActiveButton, - Ui::RoundButtonTextNoTransform); + st::defaultActiveButton); _newPollButton->setFullRadius(true); _newPollButton->setClickedCallback([=] { Window::PeerMenuCreatePoll( diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 9c0369d112..ad5c68892f 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -633,8 +633,7 @@ base::options::toggle ShowChannelJoinedBelowAbout({ const auto link = Ui::CreateChild( labelWrap, std::move(linkText), - st::defaultTableSmallButton, - Ui::RoundButtonTextNoTransform); + st::defaultTableSmallButton); link->setClickedCallback([=] { state->myTimezone = !state->myTimezone.current(); state->expanded = true; @@ -2133,8 +2132,7 @@ void DetailsFiller::setupMainApp(bool suppressBottom) { object_ptr( _wrap, tr::lng_profile_open_app(), - st::infoOpenApp, - Ui::RoundButtonTextNoTransform), + st::infoOpenApp), st::infoOpenAppMargin, style::al_justify); diff --git a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp index 59f0533907..691c37ba16 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp @@ -328,8 +328,7 @@ TopBar::TopBar( object_ptr( this, tr::lng_status_lastseen_when(), - st::infoProfileTopBarShowLastSeen, - Ui::RoundButtonTextNoTransform)) + st::infoProfileTopBarShowLastSeen)) , _forumButton([&, controller = descriptor.controller] { const auto topic = _key.topic(); if (!topic) { @@ -338,8 +337,7 @@ TopBar::TopBar( auto owned = object_ptr( this, rpl::single(QString()), - st::infoProfileTopBarTopicStatusButton, - Ui::RoundButtonTextNoTransform); + st::infoProfileTopBarTopicStatusButton); owned->setText(Info::Profile::NameValue( _peer ) | rpl::map([=](const QString &name) { diff --git a/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp b/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp index 9a993f9eaf..f91aacf6ff 100644 --- a/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp +++ b/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp @@ -156,8 +156,8 @@ void ListController::setupUnlock() { ? tr::lng_similar_channels_show_more() : tr::lng_similar_bots_show_more()), st::similarChannelsLock, - Ui::RoundButtonTextToUpper, - rpl::single(true)); + rpl::single(true), + Ui::RoundButtonTextToUpper); button->setClickedCallback([=] { const auto window = _controller->parentController(); ::Settings::ShowPremium(window, u"similar_channels"_q); diff --git a/Telegram/SourceFiles/info/stories/info_stories_inner_widget.cpp b/Telegram/SourceFiles/info/stories/info_stories_inner_widget.cpp index c22174e3c9..bceac09a79 100644 --- a/Telegram/SourceFiles/info/stories/info_stories_inner_widget.cpp +++ b/Telegram/SourceFiles/info/stories/info_stories_inner_widget.cpp @@ -717,8 +717,7 @@ void InnerWidget::refreshEmpty() { object_ptr( empty.get(), rpl::single(QString()), - st::collectionEmptyButton, - Ui::RoundButtonTextNoTransform), + st::collectionEmptyButton), st::collectionEmptyAddMargin, style::al_top); button->setText(tr::lng_stories_album_add_button( diff --git a/Telegram/SourceFiles/info/stories/info_stories_widget.cpp b/Telegram/SourceFiles/info/stories/info_stories_widget.cpp index e641def468..08a870fc76 100644 --- a/Telegram/SourceFiles/info/stories/info_stories_widget.cpp +++ b/Telegram/SourceFiles/info/stories/info_stories_widget.cpp @@ -230,8 +230,7 @@ void Widget::setupBottomButton(int wasBottomHeight) { const auto button = Ui::CreateChild( bottom, rpl::single(QString()), - st::collectionEditBox.button, - Ui::RoundButtonTextNoTransform); + st::collectionEditBox.button); button->setText(tr::lng_stories_album_add_button( ) | rpl::map([](const QString &text) { return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text); diff --git a/Telegram/SourceFiles/info/userpic/info_userpic_emoji_builder.cpp b/Telegram/SourceFiles/info/userpic/info_userpic_emoji_builder.cpp index e32c273f94..83a30ef868 100644 --- a/Telegram/SourceFiles/info/userpic/info_userpic_emoji_builder.cpp +++ b/Telegram/SourceFiles/info/userpic/info_userpic_emoji_builder.cpp @@ -44,8 +44,7 @@ void ShowLayer( const auto save = Ui::CreateChild( content.get(), tr::lng_connection_save(), - st::userpicBuilderEmojiButton, - Ui::RoundButtonTextNoTransform); + st::userpicBuilderEmojiButton); content->sizeValue( ) | rpl::on_next([=] { const auto &p = st::userpicBuilderEmojiSavePosiiton; diff --git a/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp b/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp index 672e46980e..48a6cb1e37 100644 --- a/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp @@ -512,7 +512,7 @@ void Inner::refreshSwitchPmButton(const CacheEntry *entry) { _switchPmUrl = QByteArray(); } else { if (!_switchPmButton) { - _switchPmButton.create(this, nullptr, st::switchPmButton, Ui::RoundButtonTextNoTransform); + _switchPmButton.create(this, nullptr, st::switchPmButton); _switchPmButton->show(); _switchPmButton->addClickHandler([=] { switchPm(); }); } diff --git a/Telegram/SourceFiles/intro/intro_widget.cpp b/Telegram/SourceFiles/intro/intro_widget.cpp index daa8f822e4..4684a608c0 100644 --- a/Telegram/SourceFiles/intro/intro_widget.cpp +++ b/Telegram/SourceFiles/intro/intro_widget.cpp @@ -88,7 +88,7 @@ Widget::Widget( Ui::RoundButtonTextToUpper)) , _next( this, - object_ptr(this, nullptr, *_nextStyle, Ui::RoundButtonTextNoTransform)) + object_ptr(this, nullptr, *_nextStyle)) , _connecting(std::make_unique( this, account, @@ -355,7 +355,7 @@ void Widget::setupStep() { _next.destroy(); _next.create( this, - object_ptr(this, nullptr, *nextStyle, Ui::RoundButtonTextNoTransform)); + object_ptr(this, nullptr, *nextStyle)); showControls(); updateControlsGeometry(); _next->toggle(wasShown, anim::type::instant); diff --git a/Telegram/SourceFiles/iv/iv_controller.cpp b/Telegram/SourceFiles/iv/iv_controller.cpp index 343874b215..87ab701e8c 100644 --- a/Telegram/SourceFiles/iv/iv_controller.cpp +++ b/Telegram/SourceFiles/iv/iv_controller.cpp @@ -97,8 +97,7 @@ public: const auto reset = Ui::CreateChild( this, rpl::single(QString()), - st::ivResetZoom, - Ui::RoundButtonTextNoTransform); + st::ivResetZoom); processTooltip(reset); const auto resetLabel = Ui::CreateChild( reset, diff --git a/Telegram/SourceFiles/media/stories/media_stories_controller.cpp b/Telegram/SourceFiles/media/stories/media_stories_controller.cpp index 8a1aca63c9..3ac7b92a7d 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_controller.cpp +++ b/Telegram/SourceFiles/media/stories/media_stories_controller.cpp @@ -265,8 +265,7 @@ void Controller::Unsupported::setup(not_null peer) { _button = std::make_unique( wrap, tr::lng_update_telegram(), - st::storiesUnsupportedUpdate, - Ui::RoundButtonTextNoTransform); + st::storiesUnsupportedUpdate); _button->show(); rpl::combine( diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index f2f1552b23..aa09778d85 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -1794,8 +1794,7 @@ void OverlayWidget::refreshVoteButton() { _voteButton.create( _body, tr::lng_polls_submit_votes(), - st::mediaviewVoteButton, - Ui::RoundButtonTextNoTransform); + st::mediaviewVoteButton); const auto effect = Ui::CreateChild( _voteButton.data()); effect->setOpacity(_controlsOpacity.current()); @@ -4909,8 +4908,7 @@ void OverlayWidget::initThemePreview() { _themeApply.create( _body, tr::lng_theme_preview_apply(), - st::themePreviewApplyButton, - Ui::RoundButtonTextNoTransform); + st::themePreviewApplyButton); _themeApply->show(); _themeApply->setClickedCallback([=] { const auto &object = Background()->themeObject(); @@ -4926,16 +4924,14 @@ void OverlayWidget::initThemePreview() { _themeCancel.create( _body, tr::lng_cancel(), - st::themePreviewCancelButton, - Ui::RoundButtonTextNoTransform); + st::themePreviewCancelButton); _themeCancel->show(); _themeCancel->setClickedCallback([this] { close(); }); if (const auto slug = _themeCloudData.slug; !slug.isEmpty()) { _themeShare.create( _body, tr::lng_theme_share(), - st::themePreviewCancelButton, - Ui::RoundButtonTextNoTransform); + st::themePreviewCancelButton); _themeShare->show(); _themeShare->setClickedCallback([=] { QGuiApplication::clipboard()->setText( diff --git a/Telegram/SourceFiles/media/view/media_view_playback_sponsored.cpp b/Telegram/SourceFiles/media/view/media_view_playback_sponsored.cpp index ce490ac96f..8024ceed8c 100644 --- a/Telegram/SourceFiles/media/view/media_view_playback_sponsored.cpp +++ b/Telegram/SourceFiles/media/view/media_view_playback_sponsored.cpp @@ -325,8 +325,7 @@ PlaybackSponsored::Message::Message( , _about(std::make_unique( this, tr::lng_search_sponsored_button(), - _aboutSt, - Ui::RoundButtonTextNoTransform)) + _aboutSt)) , _close( std::make_unique( this, diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp index dd7c1063cb..ca4e4989a7 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp @@ -141,8 +141,7 @@ void VerifyBox::setupControls( object_ptr( _content, tr::lng_intro_fragment_button(), - st::fragmentBoxButton, - Ui::RoundButtonTextNoTransform), + st::fragmentBoxButton), small); _content->widthValue( ) | rpl::on_next([=](int w) { diff --git a/Telegram/SourceFiles/passport/passport_panel_password.cpp b/Telegram/SourceFiles/passport/passport_panel_password.cpp index b60ccd9da3..c44a385790 100644 --- a/Telegram/SourceFiles/passport/passport_panel_password.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_password.cpp @@ -241,16 +241,14 @@ void PanelNoPassword::refreshBottom() { const auto cancel = Ui::CreateChild( container, tr::lng_cancel(), - st::defaultBoxButton, - Ui::RoundButtonTextNoTransform); + st::defaultBoxButton); cancel->addClickHandler([=] { _controller->cancelPasswordSubmit(); }); const auto validate = Ui::CreateChild( container, tr::lng_passport_email_validate(), - st::defaultBoxButton, - Ui::RoundButtonTextNoTransform); + st::defaultBoxButton); validate->addClickHandler([=] { _controller->validateRecoveryEmail(); }); diff --git a/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp b/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp index 9718e67499..bb178a0530 100644 --- a/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp @@ -83,15 +83,13 @@ FormSummary::FormSummary( tr::lng_payments_pay_amount( lt_amount, rpl::single(formatAmount(computeTotalAmount()))), - st::paymentsPanelSubmit, - RoundButtonTextNoTransform)) + st::paymentsPanelSubmit)) , _cancel( this, (_invoice.receipt.paid ? tr::lng_about_done() : tr::lng_cancel()), - st::paymentsPanelButton, - RoundButtonTextNoTransform) + st::paymentsPanelButton) , _tipLightBg(TransparentColor(st::paymentsTipActive, kLightOpacity)) , _tipLightRipple( TransparentColor(st::paymentsTipActive, kLightRippleOpacity)) @@ -397,8 +395,7 @@ void FormSummary::setupSuggestedTips(not_null layout) { .widget = CreateChild( outer, rpl::single(formatAmount(amount, true)), - st, - RoundButtonTextNoTransform), + st), }); auto &button = state->buttons.back(); button.widget->show(); diff --git a/Telegram/SourceFiles/settings/cloud_password/settings_cloud_password_common.cpp b/Telegram/SourceFiles/settings/cloud_password/settings_cloud_password_common.cpp index 1f2ce04990..4418d6415a 100644 --- a/Telegram/SourceFiles/settings/cloud_password/settings_cloud_password_common.cpp +++ b/Telegram/SourceFiles/settings/cloud_password/settings_cloud_password_common.cpp @@ -229,8 +229,7 @@ not_null AddDoneButton( object_ptr( content, std::move(text), - st::changePhoneButton, - Ui::RoundButtonTextNoTransform), + st::changePhoneButton), st::settingLocalPasscodeButtonPadding, style::al_top); return button; diff --git a/Telegram/SourceFiles/settings/sections/settings_credits.cpp b/Telegram/SourceFiles/settings/sections/settings_credits.cpp index 21b9fc0b56..f8be46fcf1 100644 --- a/Telegram/SourceFiles/settings/sections/settings_credits.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_credits.cpp @@ -496,8 +496,7 @@ void Credits::setupContent() { object_ptr( content, nullptr, - st::creditsSettingsBigBalanceButton, - Ui::RoundButtonTextNoTransform), + st::creditsSettingsBigBalanceButton), st::boxRowPadding, style::al_top); button->setContext([&]() -> Ui::Text::MarkedContext { diff --git a/Telegram/SourceFiles/settings/sections/settings_folders.cpp b/Telegram/SourceFiles/settings/sections/settings_folders.cpp index d19dcfb1ed..3ea34301bc 100644 --- a/Telegram/SourceFiles/settings/sections/settings_folders.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_folders.cpp @@ -180,12 +180,11 @@ FilterRowButton::FilterRowButton( : RippleButton(parent, st::defaultRippleAnimation) , _session(session) , _remove(this, st::filtersRemove) -, _restore(this, tr::lng_filters_restore(), st::settingsFilterAddRecommended, Ui::RoundButtonTextNoTransform) +, _restore(this, tr::lng_filters_restore(), st::settingsFilterAddRecommended) , _add( this, tr::lng_filters_recommended_add(), - st::settingsFilterAddRecommended, - Ui::RoundButtonTextNoTransform) + st::settingsFilterAddRecommended) , _state(description.isEmpty() ? State::Normal : State::Suggested) { _restore.setFullRadius(true); _add.setFullRadius(true); diff --git a/Telegram/SourceFiles/settings/sections/settings_local_passcode.cpp b/Telegram/SourceFiles/settings/sections/settings_local_passcode.cpp index 2bcc29a511..ac204ade07 100644 --- a/Telegram/SourceFiles/settings/sections/settings_local_passcode.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_local_passcode.cpp @@ -209,8 +209,7 @@ void LocalPasscodeEnter::setupContent() { : isCheck ? tr::lng_passcode_check_button() : tr::lng_passcode_change_button()), - st::changePhoneButton, - Ui::RoundButtonTextNoTransform), + st::changePhoneButton), st::settingLocalPasscodeButtonPadding, style::al_top); button->setClickedCallback([=] { diff --git a/Telegram/SourceFiles/settings/sections/settings_main.cpp b/Telegram/SourceFiles/settings/sections/settings_main.cpp index fa48873808..52bb5fe4b2 100644 --- a/Telegram/SourceFiles/settings/sections/settings_main.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_main.cpp @@ -852,8 +852,7 @@ void SetupValidatePhoneNumberSuggestion( const auto yes = Ui::CreateChild( wrap, tr::lng_box_yes(), - st::inviteLinkButton, - Ui::RoundButtonTextNoTransform); + st::inviteLinkButton); yes->setClickedCallback([=] { controller->session().promoSuggestions().dismiss( kSugValidatePhone.utf8()); @@ -862,8 +861,7 @@ void SetupValidatePhoneNumberSuggestion( const auto no = Ui::CreateChild( wrap, tr::lng_box_no(), - st::inviteLinkButton, - Ui::RoundButtonTextNoTransform); + st::inviteLinkButton); no->setClickedCallback([=] { const auto sharedLabel = std::make_shared>(); const auto height = st::boxLabel.style.font->height; @@ -954,8 +952,7 @@ void SetupValidatePasswordSuggestion( const auto yes = Ui::CreateChild( wrap, tr::lng_settings_suggestion_password_yes(), - st::inviteLinkButton, - Ui::RoundButtonTextNoTransform); + st::inviteLinkButton); yes->setClickedCallback([=] { controller->session().promoSuggestions().dismiss( Data::PromoSuggestions::SugValidatePassword()); @@ -964,8 +961,7 @@ void SetupValidatePasswordSuggestion( const auto no = Ui::CreateChild( wrap, tr::lng_settings_suggestion_password_no(), - st::inviteLinkButton, - Ui::RoundButtonTextNoTransform); + st::inviteLinkButton); no->setClickedCallback([=] { showOther(Settings::CloudPasswordSuggestionInputId()); }); diff --git a/Telegram/SourceFiles/settings/sections/settings_passkeys.cpp b/Telegram/SourceFiles/settings/sections/settings_passkeys.cpp index bc3f869d4c..9d0f52dd8a 100644 --- a/Telegram/SourceFiles/settings/sections/settings_passkeys.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_passkeys.cpp @@ -453,8 +453,7 @@ void PasskeysNoneBox( canRegister ? tr::lng_settings_passkeys_none_button() : tr::lng_settings_passkeys_none_button_unsupported(), - st::defaultActiveButton, - Ui::RoundButtonTextNoTransform); + st::defaultActiveButton); const auto createButton = button.data(); button->resizeToWidth(box->width() - st.buttonPadding.left() diff --git a/Telegram/SourceFiles/settings/sections/settings_premium.cpp b/Telegram/SourceFiles/settings/sections/settings_premium.cpp index 3cde34a72b..8d0a068139 100644 --- a/Telegram/SourceFiles/settings/sections/settings_premium.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_premium.cpp @@ -1937,8 +1937,8 @@ not_null CreateLockedButton( not_null parent, rpl::producer text, const style::RoundButton &st, - Ui::RoundButtonTextTransform transform, - rpl::producer locked) { + rpl::producer locked, + Ui::RoundButtonTextTransform transform) { const auto result = Ui::CreateChild( parent.get(), rpl::single(QString()), diff --git a/Telegram/SourceFiles/settings/sections/settings_premium.h b/Telegram/SourceFiles/settings/sections/settings_premium.h index 275234bb42..557d6cedef 100644 --- a/Telegram/SourceFiles/settings/sections/settings_premium.h +++ b/Telegram/SourceFiles/settings/sections/settings_premium.h @@ -97,8 +97,8 @@ struct SubscribeButtonArgs final { not_null parent, rpl::producer text, const style::RoundButton &st, - Ui::RoundButtonTextTransform transform, - rpl::producer locked); + rpl::producer locked, + Ui::RoundButtonTextTransform transform = Ui::RoundButtonTextTransform{}); [[nodiscard]] not_null CreateSubscribeButton( SubscribeButtonArgs &&args); diff --git a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp index 9a15348c94..f507df9a11 100644 --- a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp +++ b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp @@ -3346,8 +3346,7 @@ void AddWithdrawalWidget( const auto buttonCredits = Ui::CreateChild( buttonsContainer, tr::lng_bot_earn_balance_button_buy_ads(), - stButton, - Ui::RoundButtonTextNoTransform); + stButton); { const auto icon = Ui::CreateChild(buttonCredits); const auto &st = st::msgBotKbUrlIcon; diff --git a/Telegram/SourceFiles/statistics/chart_widget.cpp b/Telegram/SourceFiles/statistics/chart_widget.cpp index f66738036f..600299e168 100644 --- a/Telegram/SourceFiles/statistics/chart_widget.cpp +++ b/Telegram/SourceFiles/statistics/chart_widget.cpp @@ -1319,8 +1319,7 @@ void ChartWidget::processLocalZoom(int xIndex) { const auto zoomOutButton = Ui::CreateChild( header, tr::lng_stats_zoom_out(), - st::statisticsHeaderButton, - Ui::RoundButtonTextNoTransform); + st::statisticsHeaderButton); zoomOutButton->moveToRight( 0, (header->height() - zoomOutButton->height()) / 2); @@ -1532,8 +1531,7 @@ void ChartWidget::setZoomedChartData( const auto zoomOutButton = Ui::CreateChild( customHeader, tr::lng_stats_zoom_out(), - st::statisticsHeaderButton, - Ui::RoundButtonTextNoTransform); + st::statisticsHeaderButton); zoomOutButton->moveToRight( 0, (customHeader->height() - zoomOutButton->height()) / 2); diff --git a/Telegram/SourceFiles/ui/boxes/collectible_info_box.cpp b/Telegram/SourceFiles/ui/boxes/collectible_info_box.cpp index 8cb102aa14..9f9ec3ed5f 100644 --- a/Telegram/SourceFiles/ui/boxes/collectible_info_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/collectible_info_box.cpp @@ -230,8 +230,7 @@ void CollectibleInfoBox( object_ptr( box, tr::lng_collectible_learn_more(), - st::collectibleMore, - RoundButtonTextNoTransform), + st::collectibleMore), st::collectibleMorePadding); more->setClickedCallback([url = info.url] { File::OpenUrl(url); @@ -243,8 +242,7 @@ void CollectibleInfoBox( auto owned = object_ptr( box, phrase(), - st::collectibleCopy, - RoundButtonTextNoTransform); + st::collectibleCopy); const auto copy = owned.data(); copy->setClickedCallback([copyCallback] { copyCallback(true); diff --git a/Telegram/SourceFiles/ui/boxes/confirm_phone_box.cpp b/Telegram/SourceFiles/ui/boxes/confirm_phone_box.cpp index 8b95730179..6d8526f92a 100644 --- a/Telegram/SourceFiles/ui/boxes/confirm_phone_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/confirm_phone_box.cpp @@ -32,8 +32,7 @@ ConfirmPhoneBox::ConfirmPhoneBox( _fragment.create( this, tr::lng_intro_fragment_button(), - st::fragmentBoxButton, - RoundButtonTextNoTransform); + st::fragmentBoxButton); _fragment->setClickedCallback([=] { File::OpenUrl(openUrl); }); } if (timeout) { diff --git a/Telegram/SourceFiles/ui/boxes/show_or_premium_box.cpp b/Telegram/SourceFiles/ui/boxes/show_or_premium_box.cpp index c2cb37d0d5..fd1fb8ecfc 100644 --- a/Telegram/SourceFiles/ui/boxes/show_or_premium_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/show_or_premium_box.cpp @@ -157,8 +157,7 @@ void ShowOrPremiumBox( object_ptr( box, std::move(skin.showButton), - st::showOrShowButton, - RoundButtonTextNoTransform), + st::showOrShowButton), buttonPadding); box->addRow( MakeShowOrLabel(box, std::move(skin.orPremium)), diff --git a/Telegram/SourceFiles/ui/chat/choose_theme_controller.cpp b/Telegram/SourceFiles/ui/chat/choose_theme_controller.cpp index 8cbb19fc1f..68d3770400 100644 --- a/Telegram/SourceFiles/ui/chat/choose_theme_controller.cpp +++ b/Telegram/SourceFiles/ui/chat/choose_theme_controller.cpp @@ -291,13 +291,11 @@ void ChooseThemeController::initButtons() { const auto apply = CreateChild( controls, tr::lng_chat_theme_apply(), - st::defaultLightButton, - RoundButtonTextNoTransform); + st::defaultLightButton); const auto choose = CreateChild( controls, tr::lng_chat_theme_change_wallpaper(), - st::defaultLightButton, - RoundButtonTextNoTransform); + st::defaultLightButton); const auto &margin = st::chatThemeButtonMargin; controls->resize( diff --git a/Telegram/SourceFiles/ui/chat/group_call_bar.cpp b/Telegram/SourceFiles/ui/chat/group_call_bar.cpp index 3adb8cd65a..fbe3227b1a 100644 --- a/Telegram/SourceFiles/ui/chat/group_call_bar.cpp +++ b/Telegram/SourceFiles/ui/chat/group_call_bar.cpp @@ -190,8 +190,7 @@ void GroupCallBar::refreshScheduledProcess() { _join = std::make_unique( _inner.get(), tr::lng_group_call_join(), - st::groupCallTopBarJoin, - RoundButtonTextNoTransform); + st::groupCallTopBarJoin); setupRightButton(_join.get()); } } else if (!_scheduledProcess) { diff --git a/Telegram/SourceFiles/ui/controls/invite_link_buttons.cpp b/Telegram/SourceFiles/ui/controls/invite_link_buttons.cpp index e000e65614..b798465965 100644 --- a/Telegram/SourceFiles/ui/controls/invite_link_buttons.cpp +++ b/Telegram/SourceFiles/ui/controls/invite_link_buttons.cpp @@ -41,14 +41,12 @@ void AddCopyShareLinkButtons( const auto copy = CreateChild( wrap, tr::lng_group_invite_copy(), - st::inviteLinkCopy, - RoundButtonTextNoTransform); + st::inviteLinkCopy); copy->setClickedCallback(copyLink); const auto share = CreateChild( wrap, tr::lng_group_invite_share(), - st::inviteLinkShare, - RoundButtonTextNoTransform); + st::inviteLinkShare); share->setClickedCallback(shareLink); wrap->widthValue( @@ -69,8 +67,7 @@ void AddReactivateLinkButton( object_ptr( container, tr::lng_group_invite_reactivate(), - st::inviteLinkReactivate, - RoundButtonTextNoTransform), + st::inviteLinkReactivate), st::inviteLinkButtonsPadding); button->setClickedCallback(editLink); } @@ -82,8 +79,7 @@ void AddDeleteLinkButton( object_ptr( container, tr::lng_group_invite_delete(), - st::inviteLinkDelete, - RoundButtonTextNoTransform), + st::inviteLinkDelete), st::inviteLinkButtonsPadding); button->setClickedCallback(deleteLink); } diff --git a/Telegram/SourceFiles/ui/controls/location_picker.cpp b/Telegram/SourceFiles/ui/controls/location_picker.cpp index 0c0d3284c8..dd9c20334c 100644 --- a/Telegram/SourceFiles/ui/controls/location_picker.cpp +++ b/Telegram/SourceFiles/ui/controls/location_picker.cpp @@ -686,8 +686,7 @@ not_null SetupMapPlaceholder( const auto button = CreateChild( result, tr::lng_maps_select_on_map(), - st::pickLocationChooseOnMap, - RoundButtonTextNoTransform); + st::pickLocationChooseOnMap); button->setFullRadius(true); button->setClickedCallback(choose); diff --git a/Telegram/SourceFiles/ui/controls/table_rows.cpp b/Telegram/SourceFiles/ui/controls/table_rows.cpp index 6535c2e775..40692d96ea 100644 --- a/Telegram/SourceFiles/ui/controls/table_rows.cpp +++ b/Telegram/SourceFiles/ui/controls/table_rows.cpp @@ -109,8 +109,7 @@ ValueWithSmallButton MakeValueWithSmallButton( const auto button = CreateChild( raw, std::move(buttonText), - table->st().smallButton, - RoundButtonTextNoTransform); + table->st().smallButton); if (handler) { button->setClickedCallback([button, handler = std::move(handler)] { handler(button); diff --git a/Telegram/SourceFiles/window/themes/window_theme_warning.cpp b/Telegram/SourceFiles/window/themes/window_theme_warning.cpp index 1549453027..4de7a3b8c8 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_warning.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_warning.cpp @@ -29,8 +29,8 @@ WarningWidget::WarningWidget(QWidget *parent) : RpWidget(parent) , _timer([=] { handleTimer(); }) , _secondsLeft(kWaitBeforeRevertMs / 1000) -, _keepChanges(this, tr::lng_theme_keep_changes(), st::defaultBoxButton, Ui::RoundButtonTextNoTransform) -, _revert(this, tr::lng_theme_revert(), st::defaultBoxButton, Ui::RoundButtonTextNoTransform) { +, _keepChanges(this, tr::lng_theme_keep_changes(), st::defaultBoxButton) +, _revert(this, tr::lng_theme_revert(), st::defaultBoxButton) { _keepChanges->setClickedCallback([] { KeepApplied(); }); _revert->setClickedCallback([] { Revert(); }); updateText(); diff --git a/Telegram/SourceFiles/window/window_lock_widgets.cpp b/Telegram/SourceFiles/window/window_lock_widgets.cpp index bf7b9b5118..0ae535df96 100644 --- a/Telegram/SourceFiles/window/window_lock_widgets.cpp +++ b/Telegram/SourceFiles/window/window_lock_widgets.cpp @@ -98,7 +98,7 @@ PasscodeLockWidget::PasscodeLockWidget( not_null window) : LockWidget(parent, window) , _passcode(this, st::passcodeInput, tr::lng_passcode_ph()) -, _submit(this, tr::lng_passcode_submit(), st::passcodeSubmit, Ui::RoundButtonTextNoTransform) +, _submit(this, tr::lng_passcode_submit(), st::passcodeSubmit) , _logout(this, tr::lng_passcode_logout(tr::now)) { connect(_passcode, &Ui::MaskedInputField::changed, [=] { changed(); }); connect(_passcode, &Ui::MaskedInputField::submitted, [=] { submit(); }); diff --git a/Telegram/SourceFiles/window/window_setup_email.cpp b/Telegram/SourceFiles/window/window_setup_email.cpp index 877a94e0bf..48b71a1258 100644 --- a/Telegram/SourceFiles/window/window_setup_email.cpp +++ b/Telegram/SourceFiles/window/window_setup_email.cpp @@ -125,8 +125,7 @@ SetupEmailLockWidget::SetupEmailLockWidget( _logoutButton = object_ptr( this, tr::lng_settings_logout(), - st::defaultBoxButton, - Ui::RoundButtonTextNoTransform); + st::defaultBoxButton); if (session) { session->promoSuggestions().setSetupEmailState( Data::SetupEmailState::SettingUpNoSkip); @@ -150,8 +149,7 @@ SetupEmailLockWidget::SetupEmailLockWidget( _debugButton = object_ptr( this, rpl::single(u"[DEBUG] Clear bio"_q), - st::defaultBoxButton, - Ui::RoundButtonTextNoTransform); + st::defaultBoxButton); _debugButton->setClickedCallback([=] { session->api().saveSelfBio({}); }); @@ -225,8 +223,7 @@ SetupEmailLockWidget::SetupEmailLockWidget( object_ptr( _layout, tr::lng_settings_cloud_login_email_confirm(), - st::changePhoneButton, - Ui::RoundButtonTextNoTransform), + st::changePhoneButton), st::boxRowPadding, style::al_top); diff --git a/Telegram/lib_ui b/Telegram/lib_ui index d43113e6bb..841e271a57 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit d43113e6bb3508a97154ffebc3c1744fdfd2a6a3 +Subproject commit 841e271a571dd43488be101a2eff22881ac4a724 From 9cb41f451714ed3faee628f120af6d4d90ed1178 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 16:35:37 +0300 Subject: [PATCH 40/50] Replaced RoundButton text transform constructor arg with setter. --- .../SourceFiles/boxes/peers/edit_peer_color_box.cpp | 8 ++++---- .../group/ui/desktop_capture_choose_source.cpp | 12 ++++++------ .../history/view/history_view_top_bar_widget.cpp | 13 +++++++++---- .../bot/starref/info_bot_starref_setup_widget.cpp | 4 ++-- .../earn/info_channel_earn_list.cpp | 12 ++++++------ .../info/profile/info_profile_actions.cpp | 8 ++++---- .../similar_peers/info_similar_peers_widget.cpp | 4 ++-- Telegram/SourceFiles/intro/intro_widget.cpp | 12 ++++++------ .../media/stories/media_stories_stealth.cpp | 4 ++-- Telegram/SourceFiles/menu/menu_sponsored.cpp | 4 ++-- .../passport/passport_panel_edit_contact.cpp | 4 ++-- .../passport/passport_panel_edit_document.cpp | 12 ++++++------ .../passport/passport_panel_edit_scans.cpp | 4 ++-- .../SourceFiles/passport/passport_panel_form.cpp | 4 ++-- .../passport/passport_panel_password.cpp | 7 ++++--- .../SourceFiles/payments/ui/payments_edit_card.cpp | 8 ++++---- .../payments/ui/payments_edit_information.cpp | 8 ++++---- .../settings/sections/settings_credits.cpp | 4 ++-- .../settings/sections/settings_premium.cpp | 6 ++---- .../settings/sections/settings_premium.h | 7 +------ .../settings/settings_credits_graphics.cpp | 4 ++-- Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp | 4 ++-- Telegram/SourceFiles/ui/chat/group_call_bar.cpp | 4 ++-- .../SourceFiles/ui/controls/filter_link_header.cpp | 3 ++- .../window/notifications_manager_default.cpp | 4 +++- Telegram/lib_ui | 2 +- 26 files changed, 84 insertions(+), 82 deletions(-) diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp index 72c15bac6d..5f813d2b79 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp @@ -2424,13 +2424,13 @@ void EditPeerColorBox( const auto profileButton = Ui::CreateChild( buttonContainer, tr::lng_settings_color_apply(), - box->getDelegate()->style().button, - Ui::RoundButtonTextToUpper); + box->getDelegate()->style().button); + profileButton->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); const auto nameButton = Ui::CreateChild( buttonContainer, tr::lng_settings_color_apply(), - box->getDelegate()->style().button, - Ui::RoundButtonTextToUpper); + box->getDelegate()->style().button); + nameButton->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); rpl::combine( buttonContainer->widthValue(), profileButton->sizeValue(), diff --git a/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp b/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp index dcd402f419..542c4246cd 100644 --- a/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp +++ b/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp @@ -260,20 +260,20 @@ ChooseSourceProcess::ChooseSourceProcess( CreateChild( _bottom.get(), tr::lng_group_call_screen_share_start(), - st::desktopCaptureSubmit, - RoundButtonTextToUpper)) + st::desktopCaptureSubmit)) , _finish( CreateChild( _bottom.get(), tr::lng_group_call_screen_share_stop(), - st::desktopCaptureFinish, - RoundButtonTextToUpper)) + st::desktopCaptureFinish)) , _withAudio( CreateChild( _bottom.get(), tr::lng_group_call_screen_share_audio(tr::now), false, st::desktopCaptureWithAudio)) { + _submit->setTextTransform(RoundButtonTextTransform::ToUpper); + _finish->setTextTransform(RoundButtonTextTransform::ToUpper); setupPanel(); setupSources(); activate(); @@ -371,8 +371,8 @@ void ChooseSourceProcess::setupPanel() { const auto cancel = CreateChild( _bottom.get(), tr::lng_cancel(), - st::desktopCaptureCancel, - RoundButtonTextToUpper); + st::desktopCaptureCancel); + cancel->setTextTransform(RoundButtonTextTransform::ToUpper); cancel->setClickedCallback([=] { _window->close(); }); 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 56a6f0973e..6545f70d32 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -117,10 +117,10 @@ TopBarWidget::TopBarWidget( : RpWidget(parent) , _controller(controller) , _primaryWindow(controller->isPrimary()) -, _clear(this, tr::lng_selected_clear(), st::topBarClearButton, Ui::RoundButtonTextToUpper) -, _forward(this, tr::lng_selected_forward(), st::defaultActiveButton, Ui::RoundButtonTextToUpper) -, _sendNow(this, tr::lng_selected_send_now(), st::defaultActiveButton, Ui::RoundButtonTextToUpper) -, _delete(this, tr::lng_selected_delete(), st::defaultActiveButton, Ui::RoundButtonTextToUpper) +, _clear(this, tr::lng_selected_clear(), st::topBarClearButton) +, _forward(this, tr::lng_selected_forward(), st::defaultActiveButton) +, _sendNow(this, tr::lng_selected_send_now(), st::defaultActiveButton) +, _delete(this, tr::lng_selected_delete(), st::defaultActiveButton) , _back(this, st::historyTopBarBack) , _cancelChoose(this, st::topBarCloseChoose) , _call(this, st::topBarCall) @@ -132,6 +132,11 @@ TopBarWidget::TopBarWidget( , _onlineUpdater([=] { updateOnlineDisplay(); }) { setAttribute(Qt::WA_OpaquePaintEvent); + _clear->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); + _forward->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); + _sendNow->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); + _delete->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); + Lang::Updated( ) | rpl::on_next([=] { refreshLang(); diff --git a/Telegram/SourceFiles/info/bot/starref/info_bot_starref_setup_widget.cpp b/Telegram/SourceFiles/info/bot/starref/info_bot_starref_setup_widget.cpp index af6b57b99e..c85728ced9 100644 --- a/Telegram/SourceFiles/info/bot/starref/info_bot_starref_setup_widget.cpp +++ b/Telegram/SourceFiles/info/bot/starref/info_bot_starref_setup_widget.cpp @@ -447,9 +447,9 @@ private: auto result = object_ptr( parent, rpl::single(QString()), - st::starrefBottomButton, - Ui::RoundButtonTextToUpper); + st::starrefBottomButton); const auto raw = result.data(); + raw->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); rpl::combine( parent->widthValue(), raw->widthValue() diff --git a/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp b/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp index 84a3b86eb6..6614ac66ab 100644 --- a/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp +++ b/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp @@ -144,9 +144,9 @@ void AddRecipient(not_null box, const TextWithEntities &t) { object_ptr( box, rpl::single(QString()), - st::channelEarnHistoryRecipientButton, - Ui::RoundButtonTextToUpper), + st::channelEarnHistoryRecipientButton), style::al_top); + container->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); const auto label = Ui::CreateChild( container, rpl::single(t), @@ -883,10 +883,10 @@ void InnerWidget::fill() { object_ptr( container, rpl::never(), - stButton, - Ui::RoundButtonTextToUpper), + stButton), st::boxRowPadding, style::al_justify); + button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); const auto label = Ui::CreateChild( button, @@ -1236,8 +1236,8 @@ void InnerWidget::fill() { (!entry.successLink.isEmpty()) ? tr::lng_channel_earn_history_out_button() : tr::lng_box_ok(), - st::defaultActiveButton, - Ui::RoundButtonTextToUpper); + st::defaultActiveButton); + button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); button->resizeToWidth(box->width() - st.buttonPadding.left() - st.buttonPadding.left()); diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index ad5c68892f..198ced0d59 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -394,10 +394,10 @@ base::options::toggle ShowChannelJoinedBelowAbout({ object_ptr( parent, rpl::single(QString()), - st::infoHoursOuter, - Ui::RoundButtonTextToUpper), + st::infoHoursOuter), st::infoProfileLabeledPadding - st::infoHoursOuterMargin); const auto button = result->entity(); + button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); const auto inner = Ui::CreateChild(button); button->widthValue() | rpl::on_next([=](int width) { const auto margin = st::infoHoursOuterMargin; @@ -882,11 +882,11 @@ void DeleteContactNote( object_ptr( parent, rpl::single(QString()), - st::infoHoursOuter, - Ui::RoundButtonTextToUpper), + st::infoHoursOuter), st::infoProfileLabeledPadding - st::infoHoursOuterMargin); result->setDuration(st::infoSlideDuration); const auto button = result->entity(); + button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); auto outer = Ui::CreateChild>( button, diff --git a/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp b/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp index f91aacf6ff..ad7d45248c 100644 --- a/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp +++ b/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp @@ -156,8 +156,8 @@ void ListController::setupUnlock() { ? tr::lng_similar_channels_show_more() : tr::lng_similar_bots_show_more()), st::similarChannelsLock, - rpl::single(true), - Ui::RoundButtonTextToUpper); + rpl::single(true)); + button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); button->setClickedCallback([=] { const auto window = _controller->parentController(); ::Settings::ShowPremium(window, u"similar_channels"_q); diff --git a/Telegram/SourceFiles/intro/intro_widget.cpp b/Telegram/SourceFiles/intro/intro_widget.cpp index 4684a608c0..7b2448b258 100644 --- a/Telegram/SourceFiles/intro/intro_widget.cpp +++ b/Telegram/SourceFiles/intro/intro_widget.cpp @@ -84,8 +84,7 @@ Widget::Widget( object_ptr( this, tr::lng_menu_settings(), - st::defaultBoxButton, - Ui::RoundButtonTextToUpper)) + st::defaultBoxButton)) , _next( this, object_ptr(this, nullptr, *_nextStyle)) @@ -93,6 +92,7 @@ Widget::Widget( this, account, rpl::single(true))) { + _settings->entity()->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); controller->setDefaultFloatPlayerDelegate(floatPlayerDelegate()); getData()->country = ComputeNewAccountCountry(); @@ -319,8 +319,8 @@ void Widget::checkUpdateStatus() { object_ptr( this, tr::lng_menu_update(), - st::defaultBoxButton, - Ui::RoundButtonTextToUpper)); + st::defaultBoxButton)); + _update->entity()->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); if (!_showAnimation) { _update->setVisible(true); } @@ -494,8 +494,8 @@ void Widget::showResetButton() { auto entity = object_ptr( this, tr::lng_signin_reset_account(), - st::introResetButton, - Ui::RoundButtonTextToUpper); + st::introResetButton); + entity->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); _resetAccount.create(this, std::move(entity)); _resetAccount->hide(anim::type::instant); _resetAccount->entity()->setClickedCallback([this] { resetAccount(); }); diff --git a/Telegram/SourceFiles/media/stories/media_stories_stealth.cpp b/Telegram/SourceFiles/media/stories/media_stories_stealth.cpp index 494d0cd1d0..10c4c05ef4 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_stealth.cpp +++ b/Telegram/SourceFiles/media/stories/media_stories_stealth.cpp @@ -240,9 +240,9 @@ struct State { auto result = object_ptr( parent, rpl::single(QString()), - st.box.button, - Ui::RoundButtonTextToUpper); + st.box.button); const auto raw = result.data(); + raw->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); const auto label = Ui::CreateChild( raw, diff --git a/Telegram/SourceFiles/menu/menu_sponsored.cpp b/Telegram/SourceFiles/menu/menu_sponsored.cpp index debcbeac8b..49d723102b 100644 --- a/Telegram/SourceFiles/menu/menu_sponsored.cpp +++ b/Telegram/SourceFiles/menu/menu_sponsored.cpp @@ -248,8 +248,8 @@ void AboutBox( auto button = object_ptr( box, tr::lng_box_ok(), - st::defaultActiveButton, - Ui::RoundButtonTextToUpper); + st::defaultActiveButton); + button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); button->resizeToWidth(box->width() - st.buttonPadding.left() - st.buttonPadding.left()); diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp index ca4e4989a7..4fb39508f8 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp @@ -235,8 +235,8 @@ PanelEditContact::PanelEditContact( , _done( this, tr::lng_passport_save_value(), - st::passportPanelSaveValue, - Ui::RoundButtonTextToUpper) { + st::passportPanelSaveValue) { + _done->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); setupControls(data, existing); } diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp index 830a497b0a..686d280ad2 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp @@ -221,8 +221,8 @@ PanelEditDocument::PanelEditDocument( , _done( this, tr::lng_passport_save_value(), - st::passportPanelSaveValue, - Ui::RoundButtonTextToUpper) { + st::passportPanelSaveValue) { + _done->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); setupControls( &error, &data, @@ -248,8 +248,8 @@ PanelEditDocument::PanelEditDocument( , _done( this, tr::lng_passport_save_value(), - st::passportPanelSaveValue, - Ui::RoundButtonTextToUpper) { + st::passportPanelSaveValue) { + _done->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); setupControls( nullptr, nullptr, @@ -272,8 +272,8 @@ PanelEditDocument::PanelEditDocument( , _done( this, tr::lng_passport_save_value(), - st::passportPanelSaveValue, - Ui::RoundButtonTextToUpper) { + st::passportPanelSaveValue) { + _done->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); setupControls(&error, &data, nullptr, nullptr, {}, {}, {}); } diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp index 6d43841ee1..503cb74418 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp @@ -326,8 +326,8 @@ ScanButton::ScanButton( object_ptr( this, tr::lng_passport_delete_scan_undo(), - _st.restore, - Ui::RoundButtonTextToUpper)) { + _st.restore)) { + _restore->entity()->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); _delete->toggle(!deleted, anim::type::instant); _restore->toggle(deleted, anim::type::instant); } diff --git a/Telegram/SourceFiles/passport/passport_panel_form.cpp b/Telegram/SourceFiles/passport/passport_panel_form.cpp index 5ddb2f1aef..a1dd34c22c 100644 --- a/Telegram/SourceFiles/passport/passport_panel_form.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_form.cpp @@ -40,8 +40,8 @@ PanelForm::PanelForm( , _submit( this, tr::lng_passport_authorize(), - st::passportPanelAuthorize, - Ui::RoundButtonTextToUpper) { + st::passportPanelAuthorize) { + _submit->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); setupControls(); } diff --git a/Telegram/SourceFiles/passport/passport_panel_password.cpp b/Telegram/SourceFiles/passport/passport_panel_password.cpp index c44a385790..58b4ff3a2b 100644 --- a/Telegram/SourceFiles/passport/passport_panel_password.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_password.cpp @@ -47,8 +47,9 @@ PanelAskPassword::PanelAskPassword( this, st::defaultInputField, tr::lng_passport_password_placeholder()) -, _submit(this, tr::lng_passport_next(), st::passportPasswordSubmit, Ui::RoundButtonTextToUpper) +, _submit(this, tr::lng_passport_next(), st::passportPasswordSubmit) , _forgot(this, tr::lng_signin_recover(tr::now), st::defaultLinkButton) { + _submit->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); connect(_password, &Ui::PasswordInput::submitted, this, [=] { submit(); }); @@ -227,9 +228,9 @@ void PanelNoPassword::refreshBottom() { object_ptr( _inner, tr::lng_passport_password_create(), - st::defaultBoxButton, - Ui::RoundButtonTextToUpper), + st::defaultBoxButton), style::al_top); + button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); button->addClickHandler([=] { _controller->setupPassword(); }); diff --git a/Telegram/SourceFiles/payments/ui/payments_edit_card.cpp b/Telegram/SourceFiles/payments/ui/payments_edit_card.cpp index 05e93e9e7d..0c2aac434e 100644 --- a/Telegram/SourceFiles/payments/ui/payments_edit_card.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_edit_card.cpp @@ -216,13 +216,13 @@ EditCard::EditCard( , _submit( this, tr::lng_about_done(), - st::paymentsPanelButton, - RoundButtonTextToUpper) + st::paymentsPanelButton) , _cancel( this, tr::lng_cancel(), - st::paymentsPanelButton, - RoundButtonTextToUpper) { + st::paymentsPanelButton) { + _submit->setTextTransform(RoundButtonTextTransform::ToUpper); + _cancel->setTextTransform(RoundButtonTextTransform::ToUpper); setupControls(); } diff --git a/Telegram/SourceFiles/payments/ui/payments_edit_information.cpp b/Telegram/SourceFiles/payments/ui/payments_edit_information.cpp index fe5c8261cb..aa409b72c2 100644 --- a/Telegram/SourceFiles/payments/ui/payments_edit_information.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_edit_information.cpp @@ -47,13 +47,13 @@ EditInformation::EditInformation( , _submit( this, tr::lng_settings_save(), - st::paymentsPanelButton, - RoundButtonTextToUpper) + st::paymentsPanelButton) , _cancel( this, tr::lng_cancel(), - st::paymentsPanelButton, - RoundButtonTextToUpper) { + st::paymentsPanelButton) { + _submit->setTextTransform(RoundButtonTextTransform::ToUpper); + _cancel->setTextTransform(RoundButtonTextTransform::ToUpper); setupControls(); } diff --git a/Telegram/SourceFiles/settings/sections/settings_credits.cpp b/Telegram/SourceFiles/settings/sections/settings_credits.cpp index f8be46fcf1..c2d1c009a2 100644 --- a/Telegram/SourceFiles/settings/sections/settings_credits.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_credits.cpp @@ -865,10 +865,10 @@ void BuildCurrencyWithdrawalSection( object_ptr( container, rpl::never(), - stButton, - Ui::RoundButtonTextToUpper), + stButton), st::boxRowPadding, style::al_top); + button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); const auto label = Ui::CreateChild( button, diff --git a/Telegram/SourceFiles/settings/sections/settings_premium.cpp b/Telegram/SourceFiles/settings/sections/settings_premium.cpp index 8d0a068139..b3f606f975 100644 --- a/Telegram/SourceFiles/settings/sections/settings_premium.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_premium.cpp @@ -1937,13 +1937,11 @@ not_null CreateLockedButton( not_null parent, rpl::producer text, const style::RoundButton &st, - rpl::producer locked, - Ui::RoundButtonTextTransform transform) { + rpl::producer locked) { const auto result = Ui::CreateChild( parent.get(), rpl::single(QString()), - st, - transform); + st); const auto labelSt = result->lifetime().make_state( st::defaultFlatLabel); diff --git a/Telegram/SourceFiles/settings/sections/settings_premium.h b/Telegram/SourceFiles/settings/sections/settings_premium.h index 557d6cedef..894e07c352 100644 --- a/Telegram/SourceFiles/settings/sections/settings_premium.h +++ b/Telegram/SourceFiles/settings/sections/settings_premium.h @@ -17,10 +17,6 @@ namespace style { struct RoundButton; } // namespace style -namespace Ui { -enum class RoundButtonTextTransform : uchar; -} // namespace Ui - namespace ChatHelpers { class Show; } // namespace ChatHelpers @@ -97,8 +93,7 @@ struct SubscribeButtonArgs final { not_null parent, rpl::producer text, const style::RoundButton &st, - rpl::producer locked, - Ui::RoundButtonTextTransform transform = Ui::RoundButtonTextTransform{}); + rpl::producer locked); [[nodiscard]] not_null CreateSubscribeButton( SubscribeButtonArgs &&args); diff --git a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp index f507df9a11..9ac4584e40 100644 --- a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp +++ b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp @@ -3340,8 +3340,8 @@ void AddWithdrawalWidget( const auto button = Ui::CreateChild( buttonsContainer, rpl::never(), - stButton, - Ui::RoundButtonTextToUpper); + stButton); + button->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); const auto buttonCredits = Ui::CreateChild( buttonsContainer, diff --git a/Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp b/Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp index 3969f0a86c..6b32fd3c0d 100644 --- a/Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp @@ -386,8 +386,8 @@ void AddStakePresets( const auto button = CreateChild( wrap, rpl::single(FormatTonAmount(nanoTon).full + diamond), - st::stakePresetButton, - RoundButtonTextToUpper); + st::stakePresetButton); + button->setTextTransform(RoundButtonTextTransform::ToUpper); button->setClickedCallback([=] { callback(nanoTon); }); diff --git a/Telegram/SourceFiles/ui/chat/group_call_bar.cpp b/Telegram/SourceFiles/ui/chat/group_call_bar.cpp index fbe3227b1a..13481b99dd 100644 --- a/Telegram/SourceFiles/ui/chat/group_call_bar.cpp +++ b/Telegram/SourceFiles/ui/chat/group_call_bar.cpp @@ -199,8 +199,8 @@ void GroupCallBar::refreshScheduledProcess() { _open = std::make_unique( _inner.get(), _scheduledProcess->text(GroupCallScheduledLeft::Negative::Show), - st::groupCallTopBarOpen, - RoundButtonTextToUpper); + st::groupCallTopBarOpen); + _open->setTextTransform(RoundButtonTextTransform::ToUpper); setupRightButton(_open.get()); _open->widthValue( ) | rpl::on_next([=] { diff --git a/Telegram/SourceFiles/ui/controls/filter_link_header.cpp b/Telegram/SourceFiles/ui/controls/filter_link_header.cpp index 11af7d696a..2d2c8b9fe1 100644 --- a/Telegram/SourceFiles/ui/controls/filter_link_header.cpp +++ b/Telegram/SourceFiles/ui/controls/filter_link_header.cpp @@ -494,7 +494,8 @@ object_ptr FilterLinkProcessButton( rpl::producer badge) { const auto st = &st::filterInviteBox.button; const auto badgeSt = &st::filterInviteButtonBadgeStyle; - auto result = object_ptr(parent, rpl::single(u""_q), *st, RoundButtonTextToUpper); + auto result = object_ptr(parent, rpl::single(u""_q), *st); + result->setTextTransform(RoundButtonTextTransform::ToUpper); struct Data { TextWithEntities text; diff --git a/Telegram/SourceFiles/window/notifications_manager_default.cpp b/Telegram/SourceFiles/window/notifications_manager_default.cpp index eb1b8f2e4a..8fdc81c097 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.cpp +++ b/Telegram/SourceFiles/window/notifications_manager_default.cpp @@ -660,7 +660,9 @@ Notification::Notification( , _forwardedCount(forwardedCount) , _fromScheduled(fromScheduled) , _close(this, st::notifyClose) -, _reply(this, tr::lng_notification_reply(), st::defaultBoxButton, Ui::RoundButtonTextToUpper) { +, _reply(this, tr::lng_notification_reply(), st::defaultBoxButton) { + _reply->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); + Lang::Updated( ) | rpl::on_next([=] { refreshLang(); diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 841e271a57..f2e82f8a4e 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 841e271a571dd43488be101a2eff22881ac4a724 +Subproject commit f2e82f8a4eaf90180955ca4f8a0253efea766fc3 From b80f25fbc55044351bb24228027fac1f59037709 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 6 Apr 2026 17:43:56 +0300 Subject: [PATCH 41/50] Made Swift 6 local translation support optional. --- Telegram/CMakeLists.txt | 4 +++- .../platform/mac/translate_provider_mac.mm | 17 +++++++++++++++++ Telegram/cmake/telegram_options.cmake | 5 +++++ Telegram/lib_translate | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 738c93e4d9..a737da8da0 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -97,7 +97,9 @@ PRIVATE desktop-app::external_xxhash ) -telegram_add_apple_swift_runtime(Telegram) +if (NOT DESKTOP_APP_DISABLE_SWIFT6) + telegram_add_apple_swift_runtime(Telegram) +endif() target_precompile_headers(Telegram PRIVATE $<$:${src_loc}/stdafx.h>) nice_target_sources(Telegram ${src_loc} diff --git a/Telegram/SourceFiles/platform/mac/translate_provider_mac.mm b/Telegram/SourceFiles/platform/mac/translate_provider_mac.mm index f686dc7771..ff85d63bb5 100644 --- a/Telegram/SourceFiles/platform/mac/translate_provider_mac.mm +++ b/Telegram/SourceFiles/platform/mac/translate_provider_mac.mm @@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "platform/mac/translate_provider_mac.h" +#ifndef TDESKTOP_DISABLE_SWIFT6 + #include "base/weak_ptr.h" #include "spellcheck/platform/platform_language.h" #include "translate_provider_mac_swift_bridge.h" @@ -102,4 +104,19 @@ bool IsTranslateProviderAvailable() { return TranslateProviderMacSwiftIsAvailable(); } +#else // TDESKTOP_DISABLE_SWIFT6 + +// Local on-device translation disabled (no Swift 6). +namespace Platform { + +std::unique_ptr CreateTranslateProvider() { + return nullptr; +} + +bool IsTranslateProviderAvailable() { + return false; +} + +#endif // TDESKTOP_DISABLE_SWIFT6 + } // namespace Platform diff --git a/Telegram/cmake/telegram_options.cmake b/Telegram/cmake/telegram_options.cmake index 18fa73671a..402040d7f0 100644 --- a/Telegram/cmake/telegram_options.cmake +++ b/Telegram/cmake/telegram_options.cmake @@ -51,3 +51,8 @@ endif() if (DESKTOP_APP_SPECIAL_TARGET) target_compile_definitions(Telegram PRIVATE TDESKTOP_ALLOW_CLOSED_ALPHA) endif() + +option(DESKTOP_APP_DISABLE_SWIFT6 "Disable local on-device translation (build without Swift 6 on macOS)." OFF) +if (DESKTOP_APP_DISABLE_SWIFT6) + target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_SWIFT6) +endif() diff --git a/Telegram/lib_translate b/Telegram/lib_translate index 2eb70a8cce..09c1072622 160000 --- a/Telegram/lib_translate +++ b/Telegram/lib_translate @@ -1 +1 @@ -Subproject commit 2eb70a8cceb80e96076ae8cc0e79fb049bce2fa1 +Subproject commit 09c10726220e6862ca91d39b5dec5119aa0177bc From cebd3edb9ab7810d4fd45af632019a5ceb439669 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 7 Apr 2026 08:39:02 +0700 Subject: [PATCH 42/50] Fix build. --- Telegram/lib_webview | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/lib_webview b/Telegram/lib_webview index d159fcea73..ab20dc8b33 160000 --- a/Telegram/lib_webview +++ b/Telegram/lib_webview @@ -1 +1 @@ -Subproject commit d159fcea73c878a84b65166240bdebbf54c04e50 +Subproject commit ab20dc8b33fde5a1d936ad96a65f735e76f051ae From 13ddffd66ada4782e3aebce44fd3b6c6ef3ffbc2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 7 Apr 2026 11:02:14 +0700 Subject: [PATCH 43/50] Fix editor open from SendFilesBox. --- .../ui/chat/attach/attach_abstract_single_media_preview.cpp | 2 +- Telegram/SourceFiles/ui/chat/attach/attach_album_preview.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/ui/chat/attach/attach_abstract_single_media_preview.cpp b/Telegram/SourceFiles/ui/chat/attach/attach_abstract_single_media_preview.cpp index e1629203b2..d312bbc458 100644 --- a/Telegram/SourceFiles/ui/chat/attach/attach_abstract_single_media_preview.cpp +++ b/Telegram/SourceFiles/ui/chat/attach/attach_abstract_single_media_preview.cpp @@ -259,7 +259,7 @@ void AbstractSingleMediaPreview::mouseMoveEvent(QMouseEvent *e) { void AbstractSingleMediaPreview::mouseReleaseEvent(QMouseEvent *e) { if (base::take(_pressed) && isOverPreview(e->pos())) { - if (isPhoto()) { + if (e->button() == Qt::LeftButton && isPhoto()) { _photoEditorRequests.fire({}); } } diff --git a/Telegram/SourceFiles/ui/chat/attach/attach_album_preview.cpp b/Telegram/SourceFiles/ui/chat/attach/attach_album_preview.cpp index 1642dc0848..6082a4bb24 100644 --- a/Telegram/SourceFiles/ui/chat/attach/attach_album_preview.cpp +++ b/Telegram/SourceFiles/ui/chat/attach/attach_album_preview.cpp @@ -618,7 +618,7 @@ void AlbumPreview::mouseReleaseEvent(QMouseEvent *e) { } else if (const auto thumb = base::take(_pressedThumb)) { const auto was = _pressedButtonType; const auto now = thumb->buttonTypeFromPoint(e->pos()); - if (e->button() != Qt::RightButton && was == now) { + if (e->button() == Qt::LeftButton && was == now) { thumbButtonsCallback(thumb, now); } } From a17199c7a9af58e1f6463eec39b2c45f2c147e3e Mon Sep 17 00:00:00 2001 From: rdmcd Date: Fri, 3 Apr 2026 14:35:32 +0300 Subject: [PATCH 44/50] Fix startchannel deeplink: add missing stories rights and bot defaults fallback. ParseRequestedAdminRights was missing post_stories, edit_stories and delete_stories identifiers, causing all admin rights to be discarded when any of these appeared in the admin parameter. Also, startchannel always used explicit URL rights even when empty, never falling back to bot's default admin rights configured via BotFather (unlike iOS client). Unknown admin right identifiers are now skipped instead of discarding all already-parsed rights, improving forward-compatibility of deeplinks. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../SourceFiles/boxes/peers/add_bot_to_chat_box.cpp | 2 +- Telegram/SourceFiles/core/local_url_handlers.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/boxes/peers/add_bot_to_chat_box.cpp b/Telegram/SourceFiles/boxes/peers/add_bot_to_chat_box.cpp index 0dc3bd9d06..d8c6001d4c 100644 --- a/Telegram/SourceFiles/boxes/peers/add_bot_to_chat_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/add_bot_to_chat_box.cpp @@ -217,7 +217,7 @@ void AddBotToGroupBoxController::addBotToGroup(not_null chat) { controller->hideLayer(); controller->showPeerHistory(chat, Way::ClearStack, ShowAtUnreadMsgId); }; - const auto rights = requestedAddAdmin + const auto rights = (requestedAddAdmin && _requestedRights != 0) ? _requestedRights : (chat->isBroadcast() && chat->asBroadcast()->canAddAdmins()) diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 3abb775ec4..4222b11967 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -460,7 +460,9 @@ bool ShowWallPaper( const QString &value) { auto result = ChatAdminRights(); for (const auto &element : value.split(QRegularExpression(u"[+ ]"_q))) { - if (element == u"change_info"_q) { + if (element.isEmpty()) { + continue; + } else if (element == u"change_info"_q) { result |= ChatAdminRight::ChangeInfo; } else if (element == u"post_messages"_q) { result |= ChatAdminRight::PostMessages; @@ -478,6 +480,12 @@ bool ShowWallPaper( result |= ChatAdminRight::PinMessages; } else if (element == u"promote_members"_q) { result |= ChatAdminRight::AddAdmins; + } else if (element == u"post_stories"_q) { + result |= ChatAdminRight::PostStories; + } else if (element == u"edit_stories"_q) { + result |= ChatAdminRight::EditStories; + } else if (element == u"delete_stories"_q) { + result |= ChatAdminRight::DeleteStories; } else if (element == u"manage_video_chats"_q) { result |= ChatAdminRight::ManageCall; } else if (element == u"manage_direct_messages"_q) { @@ -487,7 +495,7 @@ bool ShowWallPaper( } else if (element == u"manage_chat"_q) { result |= ChatAdminRight::Other; } else { - return {}; + continue; } } return result; From 3bbef51448e18a3daaed5a41540f1075c1afb52d Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 6 Apr 2026 17:00:06 +0700 Subject: [PATCH 45/50] Add an experimental option for "AI Tools" button. --- .../SourceFiles/history/history_widget.cpp | 18 ++++-------------- .../controls/history_view_compose_controls.cpp | 18 ++++-------------- .../settings/settings_experimental.cpp | 2 ++ .../ui/controls/compose_ai_button_factory.cpp | 12 +++++++++++- .../ui/controls/compose_ai_button_factory.h | 2 ++ 5 files changed, 23 insertions(+), 29 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 9b5e34dc77..cd39b38f1c 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -54,6 +54,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/painter.h" #include "ui/rect.h" #include "ui/power_saving.h" +#include "ui/controls/compose_ai_button_factory.h" #include "ui/controls/emoji_button.h" #include "ui/controls/send_button.h" #include "ui/controls/send_as_button.h" @@ -6246,20 +6247,9 @@ bool HistoryWidget::fieldOrDisabledShown() const { } bool HistoryWidget::hasEnoughLinesForAi() const { - if (!_history - || _voiceRecordBar->isActive() - || session().appConfig().aiComposeStyles().empty()) { - return false; - } - const auto &style = _field->st().style; - const auto lineHeight = style.lineHeight - ? style.lineHeight - : style.font->height; - const auto margins = _field->fullTextMargins(); - const auto contentHeight = _field->height() - - margins.top() - - margins.bottom(); - return contentHeight >= (3 * lineHeight); + return _history + && !_voiceRecordBar->isActive() + && Ui::HasEnoughLinesForAi(&session(), _field); } void HistoryWidget::updateAiButtonVisibility() { diff --git a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp index 8780c92df8..b96697a8ef 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp @@ -92,6 +92,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/dropdown_menu.h" #include "ui/widgets/popup_menu.h" #include "ui/text/format_values.h" +#include "ui/controls/compose_ai_button_factory.h" #include "ui/controls/emoji_button.h" #include "ui/controls/send_button.h" #include "ui/controls/send_as_button.h" @@ -3640,20 +3641,9 @@ bool ComposeControls::canSendAiComposeDirect() const { } bool ComposeControls::hasEnoughLinesForAi() const { - if (!_history - || _recording.current() - || session().appConfig().aiComposeStyles().empty()) { - return false; - } - const auto &style = _field->st().style; - const auto lineHeight = style.lineHeight - ? style.lineHeight - : style.font->height; - const auto margins = _field->fullTextMargins(); - const auto contentHeight = _field->height() - - margins.top() - - margins.bottom(); - return contentHeight >= (3 * lineHeight); + return _history + && !_recording.current() + && Ui::HasEnoughLinesForAi(&session(), _field); } bool ComposeControls::updateBotCommandShown() { diff --git a/Telegram/SourceFiles/settings/settings_experimental.cpp b/Telegram/SourceFiles/settings/settings_experimental.cpp index 57747c20d5..31315bdae3 100644 --- a/Telegram/SourceFiles/settings/settings_experimental.cpp +++ b/Telegram/SourceFiles/settings/settings_experimental.cpp @@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/vertical_list.h" #include "ui/gl/gl_detection.h" #include "ui/chat/chat_style_radius.h" +#include "ui/controls/compose_ai_button_factory.h" #include "base/options.h" #include "boxes/moderate_messages_box.h" #include "core/application.h" @@ -233,6 +234,7 @@ void SetupExperimental( addToggle(kModerateCommonGroups); addToggle(kForceComposeSearchOneColumn); addToggle(ChatHelpers::kOptionUnlimitedRecentStickers); + addToggle(Ui::kOptionHideAiButton); } } // namespace diff --git a/Telegram/SourceFiles/ui/controls/compose_ai_button_factory.cpp b/Telegram/SourceFiles/ui/controls/compose_ai_button_factory.cpp index 12df0832a0..8601b9a2ef 100644 --- a/Telegram/SourceFiles/ui/controls/compose_ai_button_factory.cpp +++ b/Telegram/SourceFiles/ui/controls/compose_ai_button_factory.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "ui/controls/compose_ai_button_factory.h" +#include "base/options.h" #include "boxes/compose_ai_box.h" #include "history/view/controls/history_view_compose_ai_button.h" #include "lang/lang_keys.h" @@ -19,10 +20,19 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Ui { +const char kOptionHideAiButton[] = "hide-ai-button"; + +base::options::toggle HideAiButtonOption({ + .id = kOptionHideAiButton, + .name = "Hide AI button", + .description = "Hide the AI Tools button in message compose fields.", +}); + bool HasEnoughLinesForAi( not_null session, not_null field) { - if (session->appConfig().aiComposeStyles().empty()) { + if (HideAiButtonOption.value() + || session->appConfig().aiComposeStyles().empty()) { return false; } const auto &style = field->st().style; diff --git a/Telegram/SourceFiles/ui/controls/compose_ai_button_factory.h b/Telegram/SourceFiles/ui/controls/compose_ai_button_factory.h index 5acb15b297..6044c8fe14 100644 --- a/Telegram/SourceFiles/ui/controls/compose_ai_button_factory.h +++ b/Telegram/SourceFiles/ui/controls/compose_ai_button_factory.h @@ -23,6 +23,8 @@ class ComposeAiButton; namespace Ui { +extern const char kOptionHideAiButton[]; + [[nodiscard]] bool HasEnoughLinesForAi( not_null session, not_null field); From b1d21600cf2bc3ba557488717491f48e19384dbc Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 7 Apr 2026 00:49:56 +0700 Subject: [PATCH 46/50] Elide too long call button text. --- Telegram/SourceFiles/calls/calls.style | 1 + .../ui/controls/call_mute_button.cpp | 45 ++++++++++++++++--- Telegram/lib_ui | 2 +- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/calls/calls.style b/Telegram/SourceFiles/calls/calls.style index 10fcaad944..2c79e422d0 100644 --- a/Telegram/SourceFiles/calls/calls.style +++ b/Telegram/SourceFiles/calls/calls.style @@ -101,6 +101,7 @@ callButtonLabel: FlatLabel(defaultFlatLabel) { style: TextStyle(defaultTextStyle) { font: font(11px); } + maxHeight: 16px; } callAnswer: CallButton { diff --git a/Telegram/SourceFiles/ui/controls/call_mute_button.cpp b/Telegram/SourceFiles/ui/controls/call_mute_button.cpp index 4f68587a23..b623beb1d1 100644 --- a/Telegram/SourceFiles/ui/controls/call_mute_button.cpp +++ b/Telegram/SourceFiles/ui/controls/call_mute_button.cpp @@ -200,6 +200,7 @@ public: const style::FlatLabel &st = st::defaultFlatLabel); int contentHeight() const; + void setMaxWidth(int width); private: void setText(const QString &text); @@ -212,6 +213,8 @@ private: Text::String _text; Text::String _previousText; + int _maxLabelWidth = 0; + Animations::Simple _animation; }; @@ -248,28 +251,36 @@ AnimatedLabel::AnimatedLabel( p.setOpacity(1. - progress); if (p.opacity()) { - _previousText.draw( + _previousText.drawElided( p, 0, anim::interpolate(center, diffHeight, progress), width(), + 1, style::al_center); } p.setOpacity(progress); if (p.opacity()) { - _text.draw( + _text.drawElided( p, 0, anim::interpolate(0, center, progress), width(), + 1, style::al_center); } }, lifetime()); } int AnimatedLabel::contentHeight() const { - return _st.style.font->height; + const auto lineHeight = _st.style.font->height; + if (!_maxLabelWidth) { + return lineHeight; + } + const auto textHeight = _text.countHeight(_maxLabelWidth); + const auto previousHeight = _previousText.countHeight(_maxLabelWidth); + return std::min(std::max(textHeight, previousHeight), lineHeight * 2); } void AnimatedLabel::setText(const QString &text) { @@ -279,9 +290,11 @@ void AnimatedLabel::setText(const QString &text) { _previousText = std::move(_text); _text = Ui::Text::String(_st.style, text, _options); - const auto width = std::max( - _st.style.font->width(_text.toString()), - _st.style.font->width(_previousText.toString())); + const auto width = _maxLabelWidth + ? _maxLabelWidth + : std::max( + _st.style.font->width(_text.toString()), + _st.style.font->width(_previousText.toString())); resize( width + _additionalHeight, contentHeight() + _additionalHeight * 2); @@ -290,6 +303,16 @@ void AnimatedLabel::setText(const QString &text) { _animation.start([=] { update(); }, 0., 1., _duration); } +void AnimatedLabel::setMaxWidth(int width) { + _maxLabelWidth = width; + if (!_text.isEmpty()) { + resize( + _maxLabelWidth + _additionalHeight, + contentHeight() + _additionalHeight * 2); + update(); + } +} + class BlobsWidget final : public RpWidget { public: BlobsWidget( @@ -614,6 +637,16 @@ void CallMuteButton::refreshLabels() { updateCenterLabelGeometry(my, size); }, _centerLabel->lifetime()); _centerLabel->setAttribute(Qt::WA_TransparentForMouseEvents); + + _content->sizeValue( + ) | rpl::map([](QSize size) { + return size.width(); + }) | rpl::distinct_until_changed( + ) | rpl::on_next([=](int w) { + _centerLabel->setMaxWidth(w); + _label->setMaxWidth(w); + _sublabel->setMaxWidth(w); + }, _centerLabel->lifetime()); } void CallMuteButton::refreshIcons() { diff --git a/Telegram/lib_ui b/Telegram/lib_ui index f2e82f8a4e..bcb18cb15d 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit f2e82f8a4eaf90180955ca4f8a0253efea766fc3 +Subproject commit bcb18cb15d913ec0735ae3b3bbb15941d5772f5b From a5307489ff8a1fee93ef253b509570ed14ce2175 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 7 Apr 2026 10:24:16 +0700 Subject: [PATCH 47/50] Accept also base64 (non-url) secrets. --- Telegram/SourceFiles/boxes/connection_box.cpp | 6 +++++- Telegram/SourceFiles/core/local_url_handlers.cpp | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index e5d4d9ce5d..1bdb77d824 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -153,9 +153,13 @@ void AddProxyFromClipboard( const auto type = isSocks ? ProxyData::Type::Socks5 : ProxyData::Type::Mtproto; - const auto fields = url_parse_params( + auto fields = url_parse_params( match->captured(1), qthelp::UrlParamNameTransform::ToLower); + if (type == ProxyData::Type::Mtproto) { + auto &secret = fields[u"secret"_q]; + secret.replace('+', '-').replace('/', '_'); + } const auto proxy = ProxyDataFromFields(type, fields); if (!proxy) { const auto status = proxy.status(); diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 4222b11967..b3ea2eedb6 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -388,6 +388,8 @@ bool ApplyMtprotoProxy( auto params = url_parse_params( match->captured(1), qthelp::UrlParamNameTransform::ToLower); + auto &secret = params[u"secret"_q]; + secret.replace('+', '-').replace('/', '_'); ProxiesBoxController::ShowApplyConfirmation( controller, MTP::ProxyData::Type::Mtproto, From f869ad620e0627af79d0760c55c12f1e0c208753 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Tue, 7 Apr 2026 08:01:46 +0300 Subject: [PATCH 48/50] Fixed detailed button crash when accessibility queried toggle early. --- .../SourceFiles/settings/detailed_settings_button.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/settings/detailed_settings_button.cpp b/Telegram/SourceFiles/settings/detailed_settings_button.cpp index 7c305fed52..ffaf8e19bb 100644 --- a/Telegram/SourceFiles/settings/detailed_settings_button.cpp +++ b/Telegram/SourceFiles/settings/detailed_settings_button.cpp @@ -16,6 +16,10 @@ DetailedSettingsButton::DetailedSettingsButton( , _style(rowStyle) , _title(0) , _description(0) +, _toggle(std::make_unique( + _style.button.toggle, + false, + [this] { rtlupdate(toggleRect()); })) , _iconForeground(icon.icon) , _iconBackground(icon.background) , _iconBackgroundBrush(std::move(icon.backgroundBrush)) { @@ -38,10 +42,6 @@ DetailedSettingsButton::DetailedSettingsButton( kDefaultTextOptions); refreshLayout(); }, lifetime()); - _toggle = std::make_unique( - _style.button.toggle, - false, - [this] { rtlupdate(toggleRect()); }); addClickHandler([=] { if (!_toggleLocked) { _toggle->setChecked(!_toggle->checked(), anim::type::normal); From eeafe9761409592bc1af3fb485118328f1019054 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 7 Apr 2026 10:54:39 +0700 Subject: [PATCH 49/50] More strict checks in ffmpeg decodiing. --- Telegram/SourceFiles/ffmpeg/ffmpeg_frame_generator.cpp | 2 +- Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp | 2 +- Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp | 5 ++++- .../media/streaming/media_streaming_utility.cpp | 4 +++- .../media/streaming/media_streaming_video_track.cpp | 7 ++++++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/ffmpeg/ffmpeg_frame_generator.cpp b/Telegram/SourceFiles/ffmpeg/ffmpeg_frame_generator.cpp index 365ce64529..0f35c5ff23 100644 --- a/Telegram/SourceFiles/ffmpeg/ffmpeg_frame_generator.cpp +++ b/Telegram/SourceFiles/ffmpeg/ffmpeg_frame_generator.cpp @@ -182,7 +182,7 @@ FrameGenerator::Frame FrameGenerator::Impl::renderCurrent( const auto withAlpha = bgra || (srcFormat == AV_PIX_FMT_YUVA420P); const auto dstPerLine = storage.bytesPerLine(); auto dst = storage.bits() + dx * sizeof(int32) + dy * dstPerLine; - if (srcSize == dstSize && bgra) { + if (bgra && srcSize == dstSize && frame->linesize[0] > 0) { const auto srcPerLine = frame->linesize[0]; const auto perLine = std::min(srcPerLine, int(dstPerLine)); auto src = frame->data[0]; diff --git a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp index d1fbc73486..56e612358e 100644 --- a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp +++ b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp @@ -691,7 +691,7 @@ QImage CreateFrameStorage(QSize size) { ? (widthAlign - (width % widthAlign)) : 0); const auto perLine = neededWidth * kPixelBytesSize; - const auto buffer = new uchar[perLine * height + kAlignImageBy]; + const auto buffer = new uchar[size_t(perLine) * height + kAlignImageBy]; const auto cleanupData = static_cast(buffer); const auto address = reinterpret_cast(buffer); const auto alignedBuffer = buffer + ((address % kAlignImageBy) diff --git a/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp b/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp index 22bbfd6d5f..67d6df50e4 100644 --- a/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp +++ b/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp @@ -231,7 +231,10 @@ bool FFMpegReaderImplementation::renderFrame( : _frame->format; const auto bgra = (format == AV_PIX_FMT_BGRA); hasAlpha = bgra || (format == AV_PIX_FMT_YUVA420P); - if (_frame->width == toSize.width() && _frame->height == toSize.height() && bgra) { + if (bgra + && _frame->width == toSize.width() + && _frame->height == toSize.height() + && _frame->linesize[0] > 0) { int32 sbpl = _frame->linesize[0], dbpl = to.bytesPerLine(), bpl = qMin(sbpl, dbpl); uchar *s = _frame->data[0], *d = to.bits(); for (int32 i = 0, l = _frame->height; i < l; ++i) { diff --git a/Telegram/SourceFiles/media/streaming/media_streaming_utility.cpp b/Telegram/SourceFiles/media/streaming/media_streaming_utility.cpp index fdfbe20f82..68ccc55370 100644 --- a/Telegram/SourceFiles/media/streaming/media_streaming_utility.cpp +++ b/Telegram/SourceFiles/media/streaming/media_streaming_utility.cpp @@ -158,7 +158,9 @@ QImage ConvertFrame( const auto format = AV_PIX_FMT_BGRA; const auto hasDesiredFormat = (frame->format == format); - if (frameSize == storage.size() && hasDesiredFormat) { + if (hasDesiredFormat + && frameSize == storage.size() + && frame->linesize[0] > 0) { static_assert(sizeof(uint32) == FFmpeg::kPixelBytesSize); auto to = reinterpret_cast(storage.bits()); auto from = reinterpret_cast(frame->data[0]); diff --git a/Telegram/SourceFiles/media/streaming/media_streaming_video_track.cpp b/Telegram/SourceFiles/media/streaming/media_streaming_video_track.cpp index bf5521c2cd..fc1e09ef2f 100644 --- a/Telegram/SourceFiles/media/streaming/media_streaming_video_track.cpp +++ b/Telegram/SourceFiles/media/streaming/media_streaming_video_track.cpp @@ -373,6 +373,11 @@ auto VideoTrackObject::readFrame(not_null frame) -> FrameResult { _waitingForData.fire({}); return FrameResult::Waiting; } + const auto decodedFrame = _stream.decodedFrame.get(); + if (int64(decodedFrame->width) * decodedFrame->height > kMaxFrameArea) { + fail(Error::InvalidData); + return FrameResult::Error; + } const auto position = currentFramePosition(); if (position == kTimeUnknown) { fail(Error::InvalidData); @@ -649,7 +654,7 @@ bool VideoTrackObject::tryReadFirstFrame(FFmpeg::Packet &&packet) { bool VideoTrackObject::processFirstFrame() { const auto decodedFrame = _stream.decodedFrame.get(); - if (decodedFrame->width * decodedFrame->height > kMaxFrameArea) { + if (int64(decodedFrame->width) * decodedFrame->height > kMaxFrameArea) { return false; } else if (decodedFrame->hw_frames_ctx) { if (!_stream.transferredFrame) { From fef4e14fb052ec5d31606da397796c1e56810f83 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 7 Apr 2026 12:13:24 +0700 Subject: [PATCH 50/50] Version 6.7.4. - Add experimental option for "AI Tools" button. - Jump between markers with Alt+Arrows in media view. - Info button in AI Tools box. - Show warning for unofficial app builds. - Allow text emojify without selecting a style. - Accept also base64 (non-url) proxy secrets. - Use tg:// deeplinks for proxy share links. - Fix newbot deeplink parsing with trailing slash and unicode names. - Fix file reference refresh for user, group and channel photos. - Fix stale macOS tray icon colors after appearance switches. - Fix tooltip crash in top peers selector with small width. - Fix preserving markers after video quality switch in media view. --- Telegram/Resources/uwp/AppX/AppxManifest.xml | 2 +- Telegram/Resources/winrc/Telegram.rc | 8 ++++---- Telegram/Resources/winrc/Updater.rc | 8 ++++---- Telegram/SourceFiles/core/version.h | 4 ++-- Telegram/build/version | 8 ++++---- changelog.txt | 15 +++++++++++++++ 6 files changed, 30 insertions(+), 15 deletions(-) diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml index 7fff59cc2d..b39491fa45 100644 --- a/Telegram/Resources/uwp/AppX/AppxManifest.xml +++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml @@ -10,7 +10,7 @@ + Version="6.7.4.0" /> Telegram Desktop Telegram Messenger LLP diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index ffeb37979e..62e9a6b36d 100644 --- a/Telegram/Resources/winrc/Telegram.rc +++ b/Telegram/Resources/winrc/Telegram.rc @@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 6,7,3,0 - PRODUCTVERSION 6,7,3,0 + FILEVERSION 6,7,4,0 + PRODUCTVERSION 6,7,4,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -62,10 +62,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram FZ-LLC" VALUE "FileDescription", "Telegram Desktop" - VALUE "FileVersion", "6.7.3.0" + VALUE "FileVersion", "6.7.4.0" VALUE "LegalCopyright", "Copyright (C) 2014-2026" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "6.7.3.0" + VALUE "ProductVersion", "6.7.4.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index 8bf0a1ac20..56a173fda4 100644 --- a/Telegram/Resources/winrc/Updater.rc +++ b/Telegram/Resources/winrc/Updater.rc @@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 6,7,3,0 - PRODUCTVERSION 6,7,3,0 + FILEVERSION 6,7,4,0 + PRODUCTVERSION 6,7,4,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -53,10 +53,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram FZ-LLC" VALUE "FileDescription", "Telegram Desktop Updater" - VALUE "FileVersion", "6.7.3.0" + VALUE "FileVersion", "6.7.4.0" VALUE "LegalCopyright", "Copyright (C) 2014-2026" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "6.7.3.0" + VALUE "ProductVersion", "6.7.4.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index b68b287ebc..c5a0f9e772 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -22,7 +22,7 @@ constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"_cs; constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs; constexpr auto AppName = "Telegram Desktop"_cs; constexpr auto AppFile = "Telegram"_cs; -constexpr auto AppVersion = 6007003; -constexpr auto AppVersionStr = "6.7.3"; +constexpr auto AppVersion = 6007004; +constexpr auto AppVersionStr = "6.7.4"; constexpr auto AppBetaVersion = false; constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION; diff --git a/Telegram/build/version b/Telegram/build/version index df609c9f39..ad6d505e3f 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -1,7 +1,7 @@ -AppVersion 6007003 +AppVersion 6007004 AppVersionStrMajor 6.7 -AppVersionStrSmall 6.7.3 -AppVersionStr 6.7.3 +AppVersionStrSmall 6.7.4 +AppVersionStr 6.7.4 BetaChannel 0 AlphaVersion 0 -AppVersionOriginal 6.7.3 +AppVersionOriginal 6.7.4 diff --git a/changelog.txt b/changelog.txt index 09479a66d7..94170bcb3e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,18 @@ +6.7.4 (07.04.26) + +- Add experimental option for "AI Tools" button. +- Jump between markers with Alt+Arrows in video player. +- Cocoon info button in AI Tools box. +- Show warning for unofficial app builds. +- Allow text emojify without selecting a style. +- Accept also base64 (non-url) proxy secrets. +- Use tg:// deeplinks for proxy share links. +- Fix newbot deeplink parsing with trailing slash and unicode names. +- Fix file reference refresh for user, group and channel photos. +- Fix stale macOS tray icon colors after appearance switches. +- Fix tooltip crash in top peers selector with small width. +- Fix preserving markers after video quality switch in media view. + 6.7.3 (04.04.26) - Fix launch on older macOS versions.