void SendButton::setType(Type type) { if (_type != type) { _contentFrom = grabContent(); _type = type; _a_typeChanged.finish(); _contentTo = grabContent(); _a_typeChanged.start([this] { update(); }, 0., 1., st::historyRecordVoiceDuration); update(); } if (_type != Type::Record) { _recordActive = false; _a_recordActive.finish(); } }
void FadeAnimation::refreshCache() { if (!_cache.isNull()) { _cache = QPixmap(); _cache = grabContent(); Assert(!_cache.isNull()); } }
void FadeAnimation::startAnimation(int duration) { if (_cache.isNull()) { _cache = grabContent(); Assert(!_cache.isNull()); } auto from = _visible ? 0. : 1.; auto to = _visible ? 1. : 0.; _animation.start([this]() { updateCallback(); }, from, to, duration); updateCallback(); if (_widget->isHidden()) { _widget->show(); } }