mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added ability to force open media viewer from overview layout.
This commit is contained in:
parent
b366c27a0c
commit
abdd2fa99b
5 changed files with 16 additions and 7 deletions
|
@ -887,8 +887,12 @@ void ListWidget::openPhoto(not_null<PhotoData*> photo, FullMsgId id) {
|
||||||
|
|
||||||
void ListWidget::openDocument(
|
void ListWidget::openDocument(
|
||||||
not_null<DocumentData*> document,
|
not_null<DocumentData*> document,
|
||||||
FullMsgId id) {
|
FullMsgId id,
|
||||||
_controller->parentController()->openDocument(document, id);
|
bool showInMediaView) {
|
||||||
|
_controller->parentController()->openDocument(
|
||||||
|
document,
|
||||||
|
id,
|
||||||
|
showInMediaView);
|
||||||
}
|
}
|
||||||
|
|
||||||
SparseIdsMergedSlice::Key ListWidget::sliceKey(
|
SparseIdsMergedSlice::Key ListWidget::sliceKey(
|
||||||
|
|
|
@ -84,7 +84,8 @@ public:
|
||||||
void openPhoto(not_null<PhotoData*> photo, FullMsgId id) override;
|
void openPhoto(not_null<PhotoData*> photo, FullMsgId id) override;
|
||||||
void openDocument(
|
void openDocument(
|
||||||
not_null<DocumentData*> document,
|
not_null<DocumentData*> document,
|
||||||
FullMsgId id) override;
|
FullMsgId id,
|
||||||
|
bool showInMediaView = false) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Context;
|
struct Context;
|
||||||
|
|
|
@ -191,13 +191,14 @@ void ItemBase::ensureCheckboxCreated() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RadialProgressItem::setDocumentLinks(
|
void RadialProgressItem::setDocumentLinks(
|
||||||
not_null<DocumentData*> document) {
|
not_null<DocumentData*> document,
|
||||||
|
bool forceOpen) {
|
||||||
const auto context = parent()->fullId();
|
const auto context = parent()->fullId();
|
||||||
setLinks(
|
setLinks(
|
||||||
std::make_shared<DocumentOpenClickHandler>(
|
std::make_shared<DocumentOpenClickHandler>(
|
||||||
document,
|
document,
|
||||||
crl::guard(this, [=](FullMsgId id) {
|
crl::guard(this, [=](FullMsgId id) {
|
||||||
delegate()->openDocument(document, id);
|
delegate()->openDocument(document, id, forceOpen);
|
||||||
}),
|
}),
|
||||||
context),
|
context),
|
||||||
std::make_shared<DocumentSaveClickHandler>(document, context),
|
std::make_shared<DocumentSaveClickHandler>(document, context),
|
||||||
|
|
|
@ -117,7 +117,9 @@ protected:
|
||||||
ClickHandlerPtr &&openl,
|
ClickHandlerPtr &&openl,
|
||||||
ClickHandlerPtr &&savel,
|
ClickHandlerPtr &&savel,
|
||||||
ClickHandlerPtr &&cancell);
|
ClickHandlerPtr &&cancell);
|
||||||
void setDocumentLinks(not_null<DocumentData*> document);
|
void setDocumentLinks(
|
||||||
|
not_null<DocumentData*> document,
|
||||||
|
bool forceOpen = false);
|
||||||
|
|
||||||
void radialAnimationCallback(crl::time now) const;
|
void radialAnimationCallback(crl::time now) const;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,8 @@ public:
|
||||||
virtual void openPhoto(not_null<PhotoData*> photo, FullMsgId id) = 0;
|
virtual void openPhoto(not_null<PhotoData*> photo, FullMsgId id) = 0;
|
||||||
virtual void openDocument(
|
virtual void openDocument(
|
||||||
not_null<DocumentData*> document,
|
not_null<DocumentData*> document,
|
||||||
FullMsgId id) = 0;
|
FullMsgId id,
|
||||||
|
bool showInMediaView = false) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue