mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +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(
|
||||
not_null<DocumentData*> document,
|
||||
FullMsgId id) {
|
||||
_controller->parentController()->openDocument(document, id);
|
||||
FullMsgId id,
|
||||
bool showInMediaView) {
|
||||
_controller->parentController()->openDocument(
|
||||
document,
|
||||
id,
|
||||
showInMediaView);
|
||||
}
|
||||
|
||||
SparseIdsMergedSlice::Key ListWidget::sliceKey(
|
||||
|
|
|
@ -84,7 +84,8 @@ public:
|
|||
void openPhoto(not_null<PhotoData*> photo, FullMsgId id) override;
|
||||
void openDocument(
|
||||
not_null<DocumentData*> document,
|
||||
FullMsgId id) override;
|
||||
FullMsgId id,
|
||||
bool showInMediaView = false) override;
|
||||
|
||||
private:
|
||||
struct Context;
|
||||
|
|
|
@ -191,13 +191,14 @@ void ItemBase::ensureCheckboxCreated() {
|
|||
}
|
||||
|
||||
void RadialProgressItem::setDocumentLinks(
|
||||
not_null<DocumentData*> document) {
|
||||
not_null<DocumentData*> document,
|
||||
bool forceOpen) {
|
||||
const auto context = parent()->fullId();
|
||||
setLinks(
|
||||
std::make_shared<DocumentOpenClickHandler>(
|
||||
document,
|
||||
crl::guard(this, [=](FullMsgId id) {
|
||||
delegate()->openDocument(document, id);
|
||||
delegate()->openDocument(document, id, forceOpen);
|
||||
}),
|
||||
context),
|
||||
std::make_shared<DocumentSaveClickHandler>(document, context),
|
||||
|
|
|
@ -117,7 +117,9 @@ protected:
|
|||
ClickHandlerPtr &&openl,
|
||||
ClickHandlerPtr &&savel,
|
||||
ClickHandlerPtr &&cancell);
|
||||
void setDocumentLinks(not_null<DocumentData*> document);
|
||||
void setDocumentLinks(
|
||||
not_null<DocumentData*> document,
|
||||
bool forceOpen = false);
|
||||
|
||||
void radialAnimationCallback(crl::time now) const;
|
||||
|
||||
|
|
|
@ -21,7 +21,8 @@ public:
|
|||
virtual void openPhoto(not_null<PhotoData*> photo, FullMsgId id) = 0;
|
||||
virtual void openDocument(
|
||||
not_null<DocumentData*> document,
|
||||
FullMsgId id) = 0;
|
||||
FullMsgId id,
|
||||
bool showInMediaView = false) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue