2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Add manage supergroup / channel box.

This commit is contained in:
John Preston
2017-11-08 20:45:30 +04:00
parent 7f8cdf85d5
commit 3998fad7ef
35 changed files with 438 additions and 44 deletions

View File

@@ -271,7 +271,7 @@ MainWidget::MainWidget(
});
using namespace rpl::mappers;
_controller->historyPeer.value()
_controller->activePeer.value()
| rpl::map([](PeerData *peer) {
auto canWrite = peer
? Data::CanWriteValue(peer)
@@ -2432,7 +2432,7 @@ void MainWidget::ui_showPeerHistory(
break;
}
}
if (auto historyPeer = _history->peer()) {
if (auto historyPeer = _controller->historyPeer.current()) {
if (way == Way::Forward && historyPeer->id == peerId) {
way = Way::ClearStack;
}
@@ -2552,6 +2552,10 @@ void MainWidget::ui_showPeerHistory(
_dialogs->update();
}
if (!peerId) {
_controller->activePeer = nullptr;
}
checkFloatPlayerVisibility();
}
@@ -2577,10 +2581,6 @@ void MainWidget::peerAfter(const PeerData *inPeer, MsgId inMsg, PeerData *&outPe
_dialogs->peerAfter(inPeer, inMsg, outPeer, outMsg);
}
PeerData *MainWidget::historyPeer() {
return _history->peer();
}
PeerData *MainWidget::peer() {
return _overview ? _overview->peer() : _history->peer();
}
@@ -2962,6 +2962,10 @@ void MainWidget::showNewSection(
settingSection->showFast();
}
if (settingSection.data() == _mainSection.data()) {
_controller->activePeer = _mainSection->activePeer();
}
checkFloatPlayerVisibility();
orderWidgets();
}
@@ -3530,8 +3534,11 @@ void MainWidget::updateThirdColumnToCurrentPeer(
} else {
Auth().data().setTabbedReplacedWithInfo(false);
if (!peer) {
_thirdSection.destroy();
_thirdShadow.destroy();
if (_thirdSection) {
_thirdSection.destroy();
_thirdShadow.destroy();
updateControlsGeometry();
}
} else if (Adaptive::ThreeColumn()
&& Auth().data().thirdSectionInfoEnabled()) {
switchInfoFast();