Hide three-dot peer menu when peer changes.

This commit is contained in:
John Preston 2017-12-02 15:11:01 +04:00
parent 301aa9572f
commit da77c10f60
3 changed files with 7 additions and 6 deletions

View File

@ -352,8 +352,7 @@ void HistoryTopBarWidget::backClicked() {
_controller->showBackFromStack();
}
void HistoryTopBarWidget::setHistoryPeer(
not_null<PeerData*> 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();

View File

@ -55,7 +55,7 @@ public:
}
void setAnimationMode(bool enabled);
void setHistoryPeer(not_null<PeerData*> historyPeer);
void setHistoryPeer(PeerData *historyPeer);
static void paintUnreadCounter(
Painter &p,

View File

@ -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()) {