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

Added ability to show document from Controller for sections.

This commit is contained in:
23rd
2021-06-17 00:31:15 +03:00
committed by John Preston
parent eefa7263b5
commit dc0aaec4a4
16 changed files with 117 additions and 16 deletions

View File

@@ -316,6 +316,22 @@ DocumentClickHandler::DocumentClickHandler(
, _document(document) {
}
DocumentOpenClickHandler::DocumentOpenClickHandler(
not_null<DocumentData*> document,
Fn<void()> &&callback)
: DocumentClickHandler(document)
, _handler(std::move(callback)) {
}
void DocumentOpenClickHandler::onClickImpl() const {
if (_handler) {
_handler();
}
}
void DocumentOpenClickHandlerOld::onClickImpl() const {
}
void DocumentOpenClickHandler::Open(
Data::FileOrigin origin,
not_null<DocumentData*> data,
@@ -323,10 +339,6 @@ void DocumentOpenClickHandler::Open(
Data::ResolveDocument(data, context);
}
void DocumentOpenClickHandler::onClickImpl() const {
Open(context(), document(), getActionItem());
}
void DocumentSaveClickHandler::Save(
Data::FileOrigin origin,
not_null<DocumentData*> data,