mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Use new animations engine in all Basic-s.
This commit is contained in:
@@ -52,7 +52,7 @@ protected:
|
||||
private:
|
||||
void setupControls(View &&view);
|
||||
int countAvailableWidth() const;
|
||||
void step_radial(crl::time ms, bool timer);
|
||||
void radialAnimationCallback();
|
||||
void paintCheck(Painter &p, crl::time ms);
|
||||
void showMenu();
|
||||
|
||||
@@ -209,7 +209,7 @@ void ProxyRow::updateFields(View &&view) {
|
||||
if (state == State::Connecting) {
|
||||
if (!_progress) {
|
||||
_progress = std::make_unique<Ui::InfiniteRadialAnimation>(
|
||||
animation(this, &ProxyRow::step_radial),
|
||||
[=] { radialAnimationCallback(); },
|
||||
st::proxyCheckingAnimation);
|
||||
}
|
||||
_progress->start();
|
||||
@@ -219,7 +219,7 @@ void ProxyRow::updateFields(View &&view) {
|
||||
if (state == State::Checking) {
|
||||
if (!_checking) {
|
||||
_checking = std::make_unique<Ui::InfiniteRadialAnimation>(
|
||||
animation(this, &ProxyRow::step_radial),
|
||||
[=] { radialAnimationCallback(); },
|
||||
st::proxyCheckingAnimation);
|
||||
_checking->start();
|
||||
}
|
||||
@@ -241,8 +241,8 @@ void ProxyRow::updateFields(View &&view) {
|
||||
update();
|
||||
}
|
||||
|
||||
void ProxyRow::step_radial(crl::time ms, bool timer) {
|
||||
if (timer && !anim::Disabled()) {
|
||||
void ProxyRow::radialAnimationCallback() {
|
||||
if (!anim::Disabled()) {
|
||||
update();
|
||||
}
|
||||
}
|
||||
@@ -323,28 +323,22 @@ void ProxyRow::paintEvent(QPaintEvent *e) {
|
||||
|
||||
auto statusLeft = left;
|
||||
if (_checking) {
|
||||
_checking->step(ms);
|
||||
if (_checking) {
|
||||
_checking->draw(
|
||||
p,
|
||||
{
|
||||
st::proxyCheckingPosition.x() + statusLeft,
|
||||
st::proxyCheckingPosition.y() + top
|
||||
},
|
||||
width());
|
||||
statusLeft += st::proxyCheckingPosition.x()
|
||||
+ st::proxyCheckingAnimation.size.width()
|
||||
+ st::proxyCheckingSkip;
|
||||
}
|
||||
_checking->draw(
|
||||
p,
|
||||
{
|
||||
st::proxyCheckingPosition.x() + statusLeft,
|
||||
st::proxyCheckingPosition.y() + top
|
||||
},
|
||||
width());
|
||||
statusLeft += st::proxyCheckingPosition.x()
|
||||
+ st::proxyCheckingAnimation.size.width()
|
||||
+ st::proxyCheckingSkip;
|
||||
}
|
||||
p.drawTextLeft(statusLeft, top, width(), status);
|
||||
top += st::normalFont->height + st::proxyRowPadding.bottom();
|
||||
}
|
||||
|
||||
void ProxyRow::paintCheck(Painter &p, crl::time ms) {
|
||||
if (_progress) {
|
||||
_progress->step(ms);
|
||||
}
|
||||
const auto loading = _progress
|
||||
? _progress->computeState()
|
||||
: Ui::RadialState{ 0., 0, FullArcLength };
|
||||
|
Reference in New Issue
Block a user