Fixed crash in mute button disconnect with disabled animations.
This commit is contained in:
parent
1e2799245c
commit
bab4cfa5aa
1 changed files with 14 additions and 6 deletions
|
|
@ -553,25 +553,33 @@ void CallMuteButton::init() {
|
||||||
}, _centerLabel->lifetime());
|
}, _centerLabel->lifetime());
|
||||||
_centerLabel->setAttribute(Qt::WA_TransparentForMouseEvents);
|
_centerLabel->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
|
|
||||||
_radialInfo.rawShowProgress.value(
|
rpl::combine(
|
||||||
) | rpl::start_with_next([=](float64 value) {
|
_radialInfo.rawShowProgress.value(),
|
||||||
|
anim::Disables()
|
||||||
|
) | rpl::start_with_next([=](float64 value, bool disabled) {
|
||||||
auto &info = _radialInfo;
|
auto &info = _radialInfo;
|
||||||
info.realShowProgress = (1. - value) / kRadialEndPartAnimation;
|
info.realShowProgress = (1. - value) / kRadialEndPartAnimation;
|
||||||
|
|
||||||
if (((value == 0.) || anim::Disabled()) && _radial) {
|
const auto guard = gsl::finally([&] {
|
||||||
|
_content->update();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (((value == 0.) || disabled) && _radial) {
|
||||||
_radial->stop();
|
_radial->stop();
|
||||||
_radial = nullptr;
|
_radial = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((value > 0.) && !anim::Disabled() && !_radial) {
|
if ((value > 0.) && !disabled && !_radial) {
|
||||||
_radial = std::make_unique<InfiniteRadialAnimation>(
|
_radial = std::make_unique<InfiniteRadialAnimation>(
|
||||||
[=] { _content->update(); },
|
[=] { _content->update(); },
|
||||||
_radialInfo.st);
|
_radialInfo.st);
|
||||||
_radial->start();
|
_radial->start();
|
||||||
}
|
}
|
||||||
if ((info.realShowProgress < 1.) && !info.isDirectionToShow) {
|
if ((info.realShowProgress < 1.) && !info.isDirectionToShow) {
|
||||||
|
if (_radial) {
|
||||||
_radial->stop(anim::type::instant);
|
_radial->stop(anim::type::instant);
|
||||||
_radial->start();
|
_radial->start();
|
||||||
|
}
|
||||||
info.state = std::nullopt;
|
info.state = std::nullopt;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue