diff --git a/Telegram/SourceFiles/boxes/add_contact_box.cpp b/Telegram/SourceFiles/boxes/add_contact_box.cpp index a80c92daa2..16971dc05c 100644 --- a/Telegram/SourceFiles/boxes/add_contact_box.cpp +++ b/Telegram/SourceFiles/boxes/add_contact_box.cpp @@ -467,6 +467,7 @@ void GroupInfoBox::prepare() { &_navigation->parentController()->window(), Ui::UserpicButton::Role::ChoosePhoto, st::defaultUserpicButton); + _photo->showCustomOnChosen(); _title.create( this, st::defaultInputField, diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp index 085780b992..6613b63023 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp @@ -477,6 +477,7 @@ object_ptr Controller::createPhotoEdit() { st::defaultUserpicButton), st::editPeerPhotoMargins); _controls.photo = photoWrap->entity(); + _controls.photo->showCustomOnChosen(); return photoWrap; } diff --git a/Telegram/SourceFiles/intro/intro_signup.cpp b/Telegram/SourceFiles/intro/intro_signup.cpp index 4b61ba4403..da99d76316 100644 --- a/Telegram/SourceFiles/intro/intro_signup.cpp +++ b/Telegram/SourceFiles/intro/intro_signup.cpp @@ -34,6 +34,8 @@ SignupWidget::SignupWidget( , _first(this, st::introName, tr::lng_signup_firstname()) , _last(this, st::introName, tr::lng_signup_lastname()) , _invertOrder(langFirstNameGoesSecond()) { + _photo->showCustomOnChosen(); + Lang::Updated( ) | rpl::start_with_next([=] { refreshLang(); diff --git a/Telegram/SourceFiles/ui/controls/userpic_button.cpp b/Telegram/SourceFiles/ui/controls/userpic_button.cpp index 4a1bc4f075..d2da7e0448 100644 --- a/Telegram/SourceFiles/ui/controls/userpic_button.cpp +++ b/Telegram/SourceFiles/ui/controls/userpic_button.cpp @@ -207,13 +207,13 @@ void UserpicButton::prepare() { prepareUserpicPixmap(); } setClickHandlerByRole(); +} - if (_role == Role::ChangePhoto) { - chosenImages( - ) | rpl::start_with_next([=](ChosenImage &&chosen) { - showCustom(std::move(chosen.image)); - }, lifetime()); - } +void UserpicButton::showCustomOnChosen() { + chosenImages( + ) | rpl::start_with_next([=](ChosenImage &&chosen) { + showCustom(std::move(chosen.image)); + }, lifetime()); } void UserpicButton::requestSuggestAvailability() { diff --git a/Telegram/SourceFiles/ui/controls/userpic_button.h b/Telegram/SourceFiles/ui/controls/userpic_button.h index 66efbedc5f..ceef5e627c 100644 --- a/Telegram/SourceFiles/ui/controls/userpic_button.h +++ b/Telegram/SourceFiles/ui/controls/userpic_button.h @@ -100,6 +100,7 @@ public: void showCustom(QImage &&image); void showSource(Source source); + void showCustomOnChosen(); void overrideHasPersonalPhoto(bool has); [[nodiscard]] rpl::producer<> resetPersonalRequests() const;