diff --git a/Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp index 54a0cd401..2421992e7 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp @@ -12,9 +12,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_chat.h" #include "ui/widgets/labels.h" #include "ui/wrap/vertical_layout.h" -#include "ui/text/text_utilities.h" +#include "ui/text/text_utilities.h" // Ui::Text::ToUpper #include "info/profile/info_profile_button.h" -#include "info/profile/info_profile_values.h" #include "boxes/peer_list_box.h" #include "boxes/confirm_box.h" #include "boxes/add_contact_box.h" @@ -228,9 +227,8 @@ object_ptr SetupCreateGroup( auto result = object_ptr( parent, - Lang::Viewer( - lng_manage_discussion_group_create - ) | Info::Profile::ToUpperValue(), + tr::lng_manage_discussion_group_create( + ) | Ui::Text::ToUpper(), st::infoCreateLinkedChatButton); result->addClickHandler([=] { const auto guarded = crl::guard(parent, callback); @@ -253,7 +251,7 @@ object_ptr SetupUnlink( Lang::Viewer(channel->isBroadcast() ? lng_manage_discussion_group_unlink : lng_manage_linked_channel_unlink - ) | Info::Profile::ToUpperValue(), + ) | Ui::Text::ToUpper(), st::infoUnlinkChatButton); result->addClickHandler([=] { callback(nullptr); diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index e4a150f50..a25c7abb5 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -21,8 +21,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/labels.h" #include "ui/widgets/shadow.h" #include "ui/effects/ripple_animation.h" -#include "ui/special_buttons.h" +#include "ui/text/text_utilities.h" // Ui::Text::ToUpper #include "ui/image/image.h" +#include "ui/special_buttons.h" #include "inline_bots/inline_bot_result.h" #include "data/data_drafts.h" #include "data/data_session.h" @@ -45,7 +46,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/view/history_view_element.h" #include "profile/profile_block_group_members.h" #include "info/info_memento.h" -#include "info/profile/info_profile_values.h" // Info::Profile::ToUpperValue #include "core/click_handler_types.h" #include "chat_helpers/tabbed_panel.h" #include "chat_helpers/tabbed_selector.h" @@ -156,7 +156,7 @@ object_ptr SetupDiscussButton( const auto button = result.data(); auto text = Lang::Viewer( lng_channel_discuss - ) | Info::Profile::ToUpperValue(); + ) | Ui::Text::ToUpper(); const auto label = Ui::CreateChild( button, rpl::duplicate(text), diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index b89879246..05c52ce44 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/shadow.h" #include "ui/widgets/labels.h" #include "ui/toast/toast.h" +#include "ui/text/text_utilities.h" // Ui::Text::ToUpper #include "boxes/abstract_box.h" #include "boxes/confirm_box.h" #include "boxes/peer_list_box.h" @@ -96,7 +97,7 @@ auto AddMainButton( Ui::MultiSlideTracker &tracker) { tracker.track(AddActionButton( parent, - std::move(text) | ToUpperValue(), + std::move(text) | Ui::Text::ToUpper(), std::move(toggleOn), std::move(callback), st::infoMainButton)); diff --git a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp index a1ebcb48c..582440404 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp @@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "styles/style_info.h" #include "ui/widgets/labels.h" #include "ui/effects/ripple_animation.h" +#include "ui/text/text_utilities.h" // Ui::Text::ToUpper #include "ui/special_buttons.h" #include "window/window_session_controller.h" #include "observer_peer.h" @@ -446,7 +447,7 @@ void SharedMediaCover::createLabel() { using namespace rpl::mappers; auto label = object_ptr( this, - Lang::Viewer(lng_profile_shared_media) | ToUpperValue(), + Lang::Viewer(lng_profile_shared_media) | Ui::Text::ToUpper(), st::infoBlockHeaderLabel); label->setAttribute(Qt::WA_TransparentForMouseEvents); diff --git a/Telegram/SourceFiles/info/profile/info_profile_members.cpp b/Telegram/SourceFiles/info/profile/info_profile_members.cpp index f9f9137ea..e2ab05ef8 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_members.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_members.cpp @@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/input_fields.h" #include "ui/widgets/scroll_area.h" #include "ui/wrap/padding_wrap.h" +#include "ui/text/text_utilities.h" // Ui::Text::ToUpper #include "ui/search_field_controller.h" #include "lang/lang_keys.h" #include "boxes/confirm_box.h" @@ -167,7 +168,7 @@ object_ptr Members::setupTitle() { _peer ) | rpl::map([](int count) { return lng_chat_status_members(lt_count_decimal, count); - }) | ToUpperValue(), + }) | Ui::Text::ToUpper(), st::infoBlockHeaderLabel); result->setAttribute(Qt::WA_TransparentForMouseEvents); return result; diff --git a/Telegram/SourceFiles/info/profile/info_profile_values.h b/Telegram/SourceFiles/info/profile/info_profile_values.h index 7d92ced2e..c3f71bb47 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_values.h +++ b/Telegram/SourceFiles/info/profile/info_profile_values.h @@ -36,12 +36,6 @@ inline auto WithEmptyEntities() { }); } -inline auto ToUpperValue() { - return rpl::map([](QString &&text) { - return std::move(text).toUpper(); - }); -} - rpl::producer NameValue(not_null peer); rpl::producer PhoneValue(not_null user); rpl::producer BioValue(not_null user); diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp index 6d15e7e07..16983dfb2 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp @@ -10,7 +10,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "passport/passport_panel_controller.h" #include "passport/passport_panel_details_row.h" #include "info/profile/info_profile_button.h" -#include "info/profile/info_profile_values.h" #include "ui/widgets/input_fields.h" #include "ui/widgets/labels.h" #include "ui/widgets/buttons.h" @@ -18,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/wrap/vertical_layout.h" #include "ui/wrap/slide_wrap.h" #include "ui/wrap/fade_wrap.h" +#include "ui/text/text_utilities.h" // Ui::Text::ToUpper #include "boxes/abstract_box.h" #include "boxes/confirm_phone_box.h" #include "lang/lang_keys.h" @@ -322,7 +322,7 @@ void PanelEditContact::setupControls( _content->add( object_ptr( _content, - std::move(*text) | Info::Profile::ToUpperValue(), + std::move(*text) | Ui::Text::ToUpper(), st::passportDeleteButton), st::passportUploadButtonPadding )->addClickHandler([=] { diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp index eac8651e1..92d19d0cd 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp @@ -11,7 +11,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "passport/passport_panel_details_row.h" #include "passport/passport_panel_edit_scans.h" #include "info/profile/info_profile_button.h" -#include "info/profile/info_profile_values.h" #include "ui/widgets/input_fields.h" #include "ui/widgets/scroll_area.h" #include "ui/widgets/labels.h" @@ -21,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/wrap/vertical_layout.h" #include "ui/wrap/fade_wrap.h" #include "ui/wrap/slide_wrap.h" +#include "ui/text/text_utilities.h" // Ui::Text::ToUpper #include "boxes/abstract_box.h" #include "boxes/confirm_box.h" #include "lang/lang_keys.h" @@ -486,7 +486,7 @@ not_null PanelEditDocument::setupContent( inner->add( object_ptr( inner, - std::move(*text) | Info::Profile::ToUpperValue(), + std::move(*text) | Ui::Text::ToUpper(), st::passportDeleteButton), st::passportUploadButtonPadding )->addClickHandler([=] { diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp index a28fdd2fc..4dac5181a 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp @@ -10,12 +10,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "passport/passport_panel_controller.h" #include "passport/passport_panel_details_row.h" #include "info/profile/info_profile_button.h" -#include "info/profile/info_profile_values.h" #include "ui/widgets/buttons.h" #include "ui/widgets/labels.h" #include "ui/wrap/fade_wrap.h" #include "ui/wrap/slide_wrap.h" #include "ui/wrap/vertical_layout.h" +#include "ui/text/text_utilities.h" // Ui::Text::ToUpper #include "ui/text_options.h" #include "core/file_utilities.h" #include "lang/lang_keys.h" @@ -212,7 +212,7 @@ Ui::SlideWrap *EditScans::List::nonDeletedErrorRow() const { rpl::producer EditScans::List::uploadButtonText() const { return Lang::Viewer(files.empty() ? lng_passport_upload_scans - : lng_passport_upload_more) | Info::Profile::ToUpperValue(); + : lng_passport_upload_more) | Ui::Text::ToUpper(); } void EditScans::List::hideError() { @@ -686,7 +686,7 @@ void EditScans::setupSpecialScans( ) | rpl::map([=, type = type](bool created) { return Lang::Viewer(uploadKey(type, created)); }) | rpl::flatten_latest( - ) | Info::Profile::ToUpperValue(); + ) | Ui::Text::ToUpper(); scan.upload = inner->add( object_ptr( inner, diff --git a/Telegram/SourceFiles/settings/settings_advanced.cpp b/Telegram/SourceFiles/settings/settings_advanced.cpp index fbc10af8d..34ec98bac 100644 --- a/Telegram/SourceFiles/settings/settings_advanced.cpp +++ b/Telegram/SourceFiles/settings/settings_advanced.cpp @@ -13,11 +13,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/wrap/slide_wrap.h" #include "ui/widgets/labels.h" #include "ui/widgets/checkbox.h" +#include "ui/text/text_utilities.h" // Ui::Text::ToUpper #include "boxes/connection_box.h" #include "boxes/about_box.h" #include "boxes/confirm_box.h" #include "info/profile/info_profile_button.h" -#include "info/profile/info_profile_values.h" #include "platform/platform_specific.h" #include "platform/platform_info.h" #include "lang/lang_keys.h" @@ -111,7 +111,7 @@ void SetupUpdate(not_null container) { st::settingsButton); const auto update = Ui::CreateChild