From 021ada5e9e601c7c948b9c50850798885a7f5325 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 30 Apr 2019 16:53:28 +0400 Subject: [PATCH] Hide save button in media viewer when downloading. --- .../SourceFiles/media/view/media_view_overlay_widget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 70573db23..20cbea4ba 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -544,7 +544,9 @@ void OverlayWidget::updateControls() { updateThemePreviewGeometry(); _saveVisible = (_photo && _photo->loaded()) - || (_doc && _doc->filepath(DocumentData::FilePathResolve::Checked).isEmpty()); + || (_doc + && _doc->filepath(DocumentData::FilePathResolve::Checked).isEmpty() + && !_doc->loading()); _saveNav = myrtlrect(width() - st::mediaviewIconSize.width() * 2, height() - st::mediaviewIconSize.height(), st::mediaviewIconSize.width(), st::mediaviewIconSize.height()); _saveNavIcon = centerrect(_saveNav, st::mediaviewSave); _moreNav = myrtlrect(width() - st::mediaviewIconSize.width(), height() - st::mediaviewIconSize.height(), st::mediaviewIconSize.width(), st::mediaviewIconSize.height()); @@ -1203,7 +1205,8 @@ void OverlayWidget::onDownload() { } location.accessDisable(); } else { - if (_doc->filepath(DocumentData::FilePathResolve::Checked).isEmpty()) { + if (_doc->filepath(DocumentData::FilePathResolve::Checked).isEmpty() + && !_doc->loading()) { DocumentSaveClickHandler::Save( fileOrigin(), _doc,