| 204 | } |
| 205 | |
| 206 | void DualOptionsWidget::animateSelectedIndex(int index) { |
| 207 | const qreal target = static_cast<qreal>(index); |
| 208 | if (selection_animation_ == nullptr || !isVisible()) { |
| 209 | visual_selection_ = target; |
| 210 | update(); |
| 211 | return; |
| 212 | } |
| 213 | |
| 214 | selection_animation_->stop(); |
| 215 | selection_animation_->setStartValue(visual_selection_); |
| 216 | selection_animation_->setEndValue(target); |
| 217 | selection_animation_->start(); |
| 218 | } |
| 219 | |
| 220 | } // namespace PJ |