diff --git a/Telegram/SourceFiles/history/history_top_bar_widget.cpp b/Telegram/SourceFiles/history/history_top_bar_widget.cpp index 6eb8395ab9..3048f080bd 100644 --- a/Telegram/SourceFiles/history/history_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/history_top_bar_widget.cpp @@ -352,8 +352,7 @@ void HistoryTopBarWidget::backClicked() { _controller->showBackFromStack(); } -void HistoryTopBarWidget::setHistoryPeer( - not_null historyPeer) { +void HistoryTopBarWidget::setHistoryPeer(PeerData *historyPeer) { if (_historyPeer != historyPeer) { _historyPeer = historyPeer; update(); @@ -367,8 +366,10 @@ void HistoryTopBarWidget::setHistoryPeer( Ui::UserpicButton::Role::Custom, st::topBarInfoButton); _info->setAttribute(Qt::WA_TransparentForMouseEvents); - } else { - _info.destroy(); + } + if (_menu) { + _menuToggle->removeEventFilter(_menu); + _menu->hideFast(); } updateOnlineDisplay(); updateControlsVisibility(); diff --git a/Telegram/SourceFiles/history/history_top_bar_widget.h b/Telegram/SourceFiles/history/history_top_bar_widget.h index f2904f72af..05da56f3a3 100644 --- a/Telegram/SourceFiles/history/history_top_bar_widget.h +++ b/Telegram/SourceFiles/history/history_top_bar_widget.h @@ -55,7 +55,7 @@ public: } void setAnimationMode(bool enabled); - void setHistoryPeer(not_null historyPeer); + void setHistoryPeer(PeerData *historyPeer); static void paintUnreadCounter( Painter &p, diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 36650d71a3..4e265b223e 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1739,11 +1739,11 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re if (peerId) { _peer = App::peer(peerId); - _topBar->setHistoryPeer(_peer); _channel = peerToChannel(_peer->id); _canSendMessages = canSendMessages(_peer); _tabbedSelector->setCurrentPeer(_peer); } + _topBar->setHistoryPeer(_peer); updateTopBarSelection(); if (_peer && _peer->isChannel()) {