From 38dd5ab837f197c1fedca4dd03a01c8e8e9af76c Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 16 Mar 2021 18:57:46 +0400 Subject: [PATCH] Fix 'join as' userpic button display. --- Telegram/SourceFiles/calls/calls_group_panel.cpp | 1 + Telegram/SourceFiles/ui/special_buttons.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/calls/calls_group_panel.cpp b/Telegram/SourceFiles/calls/calls_group_panel.cpp index 6eac870e40..9492adfc77 100644 --- a/Telegram/SourceFiles/calls/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_group_panel.cpp @@ -735,6 +735,7 @@ void Panel::subscribeToChanges(not_null real) { _joinAsToggle->setClickedCallback([=] { chooseJoinAs(); }); + updateControlsGeometry(); }, widget()->lifetime()); } else { _menuToggle.destroy(); diff --git a/Telegram/SourceFiles/ui/special_buttons.cpp b/Telegram/SourceFiles/ui/special_buttons.cpp index 6ea4b1a662..cb4f9297b1 100644 --- a/Telegram/SourceFiles/ui/special_buttons.cpp +++ b/Telegram/SourceFiles/ui/special_buttons.cpp @@ -223,10 +223,12 @@ UserpicButton::UserpicButton( , _peer(peer) , _cropTitle(CropTitle(_peer)) , _role(role) { - Expects(_role != Role::OpenProfile); + Expects(_role != Role::OpenProfile && _role != Role::OpenPhoto); _waiting = false; + processPeerPhoto(); prepare(); + setupPeerViewers(); } void UserpicButton::prepare() { @@ -432,8 +434,10 @@ void UserpicButton::paintUserpicFrame(Painter &p, QPoint photoPosition) { if (_streamed && _streamed->player().ready() && !_streamed->player().videoSize().isEmpty()) { - const auto paused = _controller->isGifPausedAtLeastFor( - Window::GifPauseReason::RoundPlaying); + const auto paused = _controller + ? _controller->isGifPausedAtLeastFor( + Window::GifPauseReason::RoundPlaying) + : false; auto request = Media::Streaming::FrameRequest(); auto size = QSize{ _st.photoSize, _st.photoSize }; request.outer = size * cIntRetinaFactor();