2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 07:35:12 +00:00

Use crl::time/now instead of TimeMs/getms.

This commit is contained in:
John Preston
2019-02-19 10:57:53 +04:00
parent d208236994
commit fe618bd652
310 changed files with 1133 additions and 1141 deletions

View File

@@ -37,8 +37,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace {
constexpr auto kMinPreviewWidth = 20;
constexpr auto kShrinkDuration = TimeMs(150);
constexpr auto kDragDuration = TimeMs(200);
constexpr auto kShrinkDuration = crl::time(150);
constexpr auto kDragDuration = crl::time(200);
class SingleMediaPreview : public Ui::RpWidget {
public:
@@ -123,7 +123,7 @@ public:
int top,
float64 shrinkProgress,
float64 moveProgress,
TimeMs ms);
crl::time ms);
void paintPhoto(Painter &p, int left, int top, int outerWidth);
void paintFile(Painter &p, int left, int top, int outerWidth);
@@ -291,7 +291,7 @@ void AlbumThumb::paintInAlbum(
int top,
float64 shrinkProgress,
float64 moveProgress,
TimeMs ms) {
crl::time ms) {
const auto shrink = anim::interpolate(0, _shrinkSize, shrinkProgress);
_suggestedMoveAnimation.step(ms);
_lastShrinkValue = shrink;
@@ -723,7 +723,7 @@ void SingleMediaPreview::paintEvent(QPaintEvent *e) {
if (_gifPreview && _gifPreview->started()) {
auto s = QSize(_previewWidth, _previewHeight);
auto paused = _controller->isGifPausedAtLeastFor(Window::GifPauseReason::Layer);
auto frame = _gifPreview->current(s.width(), s.height(), s.width(), s.height(), ImageRoundRadius::None, RectPart::None, paused ? 0 : getms());
auto frame = _gifPreview->current(s.width(), s.height(), s.width(), s.height(), ImageRoundRadius::None, RectPart::None, paused ? 0 : crl::now());
p.drawPixmap(_previewLeft, st::boxPhotoPadding.top(), frame);
} else {
p.drawPixmap(_previewLeft, st::boxPhotoPadding.top(), _preview);
@@ -1187,7 +1187,7 @@ void SendFilesBox::AlbumPreview::paintEvent(QPaintEvent *e) {
}
void SendFilesBox::AlbumPreview::paintAlbum(Painter &p) const {
const auto ms = getms();
const auto ms = crl::now();
const auto shrink = _shrinkAnimation.current(
ms,
_draggedThumb ? 1. : 0.);