ZaStoGram_desktop/Telegram/SourceFiles/ui/widgets/level_meter.h
John Preston f97b9f3474 Keep recurring progress animations from pausing MTProto
Task: 2026/11/04/fix-native-session-delivery-pauses-init-notices-and-restarted-temporary-keys
2026-11-19 15:01:40 +04:00

39 lines
807 B
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "ui/effects/animations.h"
#include "ui/rp_widget.h"
namespace style {
struct LevelMeter;
} // namespace style
namespace Ui {
class LevelMeter : public RpWidget {
public:
LevelMeter(QWidget *parent, const style::LevelMeter &st);
void animateTo(float value, crl::time duration);
void stopAnimation();
protected:
void paintEvent(QPaintEvent *e) override;
private:
bool animationCallback(crl::time now);
const style::LevelMeter &_st;
anim::value _value;
crl::time _duration = 0;
Animations::Basic _animation;
};
} // namespace Ui