Added correct handling animations disabling in mute button.

This commit is contained in:
23rd 2020-12-03 21:09:47 +03:00
parent 5c66d1fa0a
commit f24411cd96

View file

@ -211,16 +211,6 @@ void BlobsWidget::init() {
Painter p(this); Painter p(this);
PainterHighQualityEnabler hq(p); PainterHighQualityEnabler hq(p);
if (anim::Disabled()) {
p.translate(_center, _center);
p.setPen(Qt::NoPen);
p.setBrush(_blobBrush);
const auto radius = st::callMuteMainBlobMinRadius
* kMainRadiusFactor;
p.drawEllipse(QPointF(), radius, radius);
return;
}
// Glow. // Glow.
const auto s = kGlowMinScale const auto s = kGlowMinScale
+ (1. - kGlowMinScale) * _blobs.currentLevel(); + (1. - kGlowMinScale) * _blobs.currentLevel();
@ -289,12 +279,17 @@ CallMuteButton::CallMuteButton(
: _state(initial) : _state(initial)
, _blobs(base::make_unique_q<BlobsWidget>( , _blobs(base::make_unique_q<BlobsWidget>(
parent, parent,
rpl::merge( rpl::combine(
std::move(hideBlobs), anim::Disables(),
_state.value( rpl::merge(
) | rpl::map([](const CallMuteButtonState &state) { std::move(hideBlobs),
return IsConnecting(state.type); _state.value(
})))) ) | rpl::map([](const CallMuteButtonState &state) {
return IsConnecting(state.type);
}))
) | rpl::map([](bool animDisabled, bool hide) {
return !(!animDisabled && !hide);
})))
, _content(parent, st::callMuteButtonActive, &st::callMuteButtonMuted) , _content(parent, st::callMuteButtonActive, &st::callMuteButtonMuted)
, _radial(nullptr) , _radial(nullptr)
, _colors(Colors()) , _colors(Colors())