2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Use internal section stack in Info::WrapWidget.

This commit is contained in:
John Preston
2017-10-03 14:05:58 +01:00
parent 525cde3498
commit 93c15e5ee6
63 changed files with 736 additions and 429 deletions

View File

@@ -39,7 +39,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
Q_DECLARE_METATYPE(ClickHandlerPtr);
Q_DECLARE_METATYPE(Qt::MouseButton);
Q_DECLARE_METATYPE(Ui::ShowWay);
namespace App {
namespace internal {
@@ -270,12 +269,10 @@ void autoplayMediaInlineAsync(const FullMsgId &msgId) {
}
void showPeerProfile(const PeerId &peer) {
if (auto main = App::main()) {
// main->showSection(Profile::SectionMemento(App::peer(peer)));
main->showSection(
Info::Memento(peer),
anim::type::normal,
anim::activation::normal);
if (auto window = App::wnd()) {
if (auto controller = window->controller()) {
controller->showPeerInfo(peer);
}
}
}
@@ -287,26 +284,15 @@ void showPeerOverview(const PeerId &peer, MediaOverviewType type) {
void showPeerHistory(
const PeerId &peer,
MsgId msgId,
ShowWay way,
anim::type animated,
anim::activation activation) {
MsgId msgId) {
auto ms = getms();
LOG(("Show Peer Start"));
if (MainWidget *m = App::main()) {
m->ui_showPeerHistory(peer, msgId, way, animated, activation);
if (auto m = App::main()) {
m->ui_showPeerHistory(peer, Window::SectionShow(), msgId);
}
LOG(("Show Peer End: %1").arg(getms() - ms));
}
void showPeerHistoryAsync(const PeerId &peer, MsgId msgId, ShowWay way) {
if (MainWidget *m = App::main()) {
InvokeQueued(m, [peer, msgId, way] {
showPeerHistory(peer, msgId, way);
});
}
}
PeerData *getPeerForMouseAction() {
return Messenger::Instance().ui_getPeerForMouseAction();
}