2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

Export panel minimizes to a top bar, like a Call.

This commit is contained in:
John Preston
2018-06-20 01:02:36 +01:00
parent eaf3ea9289
commit 329db0d8e9
22 changed files with 437 additions and 127 deletions

View File

@@ -10,6 +10,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "observer_peer.h"
#include "auth_session.h"
#include "apiwrap.h"
#include "export/export_controller.h"
#include "export/view/export_view_panel_controller.h"
#include "window/notifications_manager.h"
#include "history/history.h"
#include "history/history_item_components.h"
@@ -68,6 +70,32 @@ Session::Session(not_null<AuthSession*> session)
setupChannelLeavingViewer();
}
void Session::startExport() {
_export = std::make_unique<Export::ControllerWrap>();
_exportPanel = std::make_unique<Export::View::PanelController>(
_export.get());
_exportViewChanges.fire(_exportPanel.get());
_exportPanel->closed(
) | rpl::start_with_next([=] {
clearExport();
}, _export->lifetime());
}
rpl::producer<Export::View::PanelController*> Session::currentExportView(
) const {
return _exportViewChanges.events_starting_with(_exportPanel.get());
}
void Session::clearExport() {
if (_exportPanel) {
_exportPanel = nullptr;
_exportViewChanges.fire(nullptr);
}
_export = nullptr;
}
void Session::setupContactViewsViewer() {
Notify::PeerUpdateViewer(
Notify::PeerUpdate::Flag::UserIsContact