mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-08 08:04:08 +02:00
Removed bezier circle paint when animations are disabled.
This commit is contained in:
parent
c4897cec0a
commit
2035392564
1 changed files with 16 additions and 11 deletions
|
@ -571,9 +571,11 @@ void RecordCircle::paint(Painter &p, QColor c) {
|
||||||
const auto dt = crl::now() - _lastUpdateTime;
|
const auto dt = crl::now() - _lastUpdateTime;
|
||||||
_levelValue.update(dt);
|
_levelValue.update(dt);
|
||||||
|
|
||||||
|
const auto &mainRadius = st::historyRecordLevelMainRadiusAmplitude;
|
||||||
const auto radius = (st::historyRecordLevelMainRadius
|
const auto radius = (st::historyRecordLevelMainRadius
|
||||||
+ st::historyRecordLevelMainRadiusAmplitude * _levelValue.current());
|
+ (anim::Disabled() ? 0 : mainRadius * _levelValue.current()));
|
||||||
|
|
||||||
|
if (!anim::Disabled()) {
|
||||||
_majorWave->tick(radius, dt);
|
_majorWave->tick(radius, dt);
|
||||||
_minorWave->tick(radius, dt);
|
_minorWave->tick(radius, dt);
|
||||||
_lastUpdateTime = crl::now();
|
_lastUpdateTime = crl::now();
|
||||||
|
@ -584,6 +586,7 @@ void RecordCircle::paint(Painter &p, QColor c) {
|
||||||
p.setOpacity(kOpacityMinor);
|
p.setOpacity(kOpacityMinor);
|
||||||
_minorWave->paint(p, c);
|
_minorWave->paint(p, c);
|
||||||
p.setOpacity(opacity);
|
p.setOpacity(opacity);
|
||||||
|
}
|
||||||
|
|
||||||
p.setPen(Qt::NoPen);
|
p.setPen(Qt::NoPen);
|
||||||
p.setBrush(c);
|
p.setBrush(c);
|
||||||
|
@ -598,7 +601,9 @@ VoiceRecordButton::VoiceRecordButton(
|
||||||
_recordAnimationTicked.events()))
|
_recordAnimationTicked.events()))
|
||||||
, _center(st::historyRecordLevelMaxRadius)
|
, _center(st::historyRecordLevelMaxRadius)
|
||||||
, _recordingAnimation([=](crl::time now) {
|
, _recordingAnimation([=](crl::time now) {
|
||||||
|
if (!anim::Disabled()) {
|
||||||
update();
|
update();
|
||||||
|
}
|
||||||
_recordAnimationTicked.fire_copy(now);
|
_recordAnimationTicked.fire_copy(now);
|
||||||
return true;
|
return true;
|
||||||
}) {
|
}) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue