| 321 | RadialProgressItem::~RadialProgressItem() = default; |
| 322 | |
| 323 | void StatusText::update( |
| 324 | int64 newSize, |
| 325 | int64 fullSize, |
| 326 | TimeId duration, |
| 327 | TimeId realDuration) { |
| 328 | setSize(newSize); |
| 329 | if (_size == Ui::FileStatusSizeReady) { |
| 330 | _text = (duration >= 0) ? Ui::FormatDurationAndSizeText(duration, fullSize) : (duration < -1 ? Ui::FormatGifAndSizeText(fullSize) : Ui::FormatSizeText(fullSize)); |
| 331 | } else if (_size == Ui::FileStatusSizeLoaded) { |
| 332 | _text = (duration >= 0) ? Ui::FormatDurationText(duration) : (duration < -1 ? u"GIF"_q : Ui::FormatSizeText(fullSize)); |
| 333 | } else if (_size == Ui::FileStatusSizeFailed) { |
| 334 | _text = tr::lng_attach_failed(tr::now); |
| 335 | } else if (_size >= 0) { |
| 336 | _text = Ui::FormatDownloadText(_size, fullSize); |
| 337 | } else { |
| 338 | _text = Ui::FormatPlayedText(-_size - 1, realDuration); |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | void StatusText::setSize(int64 newSize) { |
| 343 | _size = newSize; |
no test coverage detected