mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix media viewer loading animation first show.
This commit is contained in:
parent
d00226d51e
commit
7797099a49
1 changed files with 15 additions and 6 deletions
|
@ -737,6 +737,16 @@ void OverlayWidget::checkForSaveLoaded() {
|
||||||
|
|
||||||
void OverlayWidget::updateControls() {
|
void OverlayWidget::updateControls() {
|
||||||
if (_document && documentBubbleShown()) {
|
if (_document && documentBubbleShown()) {
|
||||||
|
_docRect = QRect(
|
||||||
|
(width() - st::mediaviewFileSize.width()) / 2,
|
||||||
|
(height() - st::mediaviewFileSize.height()) / 2,
|
||||||
|
st::mediaviewFileSize.width(),
|
||||||
|
st::mediaviewFileSize.height());
|
||||||
|
_docIconRect = QRect(
|
||||||
|
_docRect.x() + st::mediaviewFilePadding,
|
||||||
|
_docRect.y() + st::mediaviewFilePadding,
|
||||||
|
st::mediaviewFileIconSize,
|
||||||
|
st::mediaviewFileIconSize);
|
||||||
if (_document->loading()) {
|
if (_document->loading()) {
|
||||||
_docDownload->hide();
|
_docDownload->hide();
|
||||||
_docSaveAs->hide();
|
_docSaveAs->hide();
|
||||||
|
@ -758,6 +768,11 @@ void OverlayWidget::updateControls() {
|
||||||
}
|
}
|
||||||
updateDocSize();
|
updateDocSize();
|
||||||
} else {
|
} else {
|
||||||
|
_docIconRect = QRect(
|
||||||
|
(width() - st::mediaviewFileIconSize) / 2,
|
||||||
|
(height() - st::mediaviewFileIconSize) / 2,
|
||||||
|
st::mediaviewFileIconSize,
|
||||||
|
st::mediaviewFileIconSize);
|
||||||
_docDownload->hide();
|
_docDownload->hide();
|
||||||
_docSaveAs->hide();
|
_docSaveAs->hide();
|
||||||
_docCancel->hide();
|
_docCancel->hide();
|
||||||
|
@ -2430,7 +2445,6 @@ void OverlayWidget::displayDocument(
|
||||||
}
|
}
|
||||||
refreshCaption(item);
|
refreshCaption(item);
|
||||||
|
|
||||||
_docIconRect = QRect((width() - st::mediaviewFileIconSize) / 2, (height() - st::mediaviewFileIconSize) / 2, st::mediaviewFileIconSize, st::mediaviewFileIconSize);
|
|
||||||
const auto docGeneric = Layout::DocumentGenericPreview::Create(_document);
|
const auto docGeneric = Layout::DocumentGenericPreview::Create(_document);
|
||||||
_docExt = docGeneric.ext;
|
_docExt = docGeneric.ext;
|
||||||
_docIconColor = docGeneric.color;
|
_docIconColor = docGeneric.color;
|
||||||
|
@ -2478,11 +2492,6 @@ void OverlayWidget::displayDocument(
|
||||||
_docName = st::mediaviewFileNameFont->elided(_docName, maxw, Qt::ElideMiddle);
|
_docName = st::mediaviewFileNameFont->elided(_docName, maxw, Qt::ElideMiddle);
|
||||||
_docNameWidth = st::mediaviewFileNameFont->width(_docName);
|
_docNameWidth = st::mediaviewFileNameFont->width(_docName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// _docSize is updated in updateControls()
|
|
||||||
|
|
||||||
_docRect = QRect((width() - st::mediaviewFileSize.width()) / 2, (height() - st::mediaviewFileSize.height()) / 2, st::mediaviewFileSize.width(), st::mediaviewFileSize.height());
|
|
||||||
_docIconRect = QRect(_docRect.x() + st::mediaviewFilePadding, _docRect.y() + st::mediaviewFilePadding, st::mediaviewFileIconSize, st::mediaviewFileIconSize);
|
|
||||||
} else if (_themePreviewShown) {
|
} else if (_themePreviewShown) {
|
||||||
updateThemePreviewGeometry();
|
updateThemePreviewGeometry();
|
||||||
} else if (!_staticContent.isNull()) {
|
} else if (!_staticContent.isNull()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue