2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 23:15:59 +00:00

Display download progress in the media player playback widget.

This commit is contained in:
John Preston
2016-10-13 12:12:12 +03:00
parent 956d048d56
commit d543073632
13 changed files with 44 additions and 25 deletions

View File

@@ -1368,12 +1368,9 @@ bool DocumentData::displayLoading() const {
float64 DocumentData::progress() const {
if (uploading()) {
if (size > 0) {
return float64(uploadOffset) / size;
}
return 0;
return snap((size > 0) ? float64(uploadOffset) / size : 0., 0., 1.);
}
return loading() ? _loader->currentProgress() : (loaded() ? 1 : 0);
return loading() ? _loader->currentProgress() : (loaded() ? 1. : 0.);
}
int32 DocumentData::loadOffset() const {