| 371 | } |
| 372 | |
| 373 | void CodeInput::processDigit(int digit) { |
| 374 | _digits[_currentIndex]->setDigit(digit); |
| 375 | _currentIndex = Circular(_currentIndex + 1, _digits.size()); |
| 376 | if (!_currentIndex) { |
| 377 | const auto result = collectDigits(); |
| 378 | if (result.size() == _digitsCountMax) { |
| 379 | _codeCollected.fire_copy(result); |
| 380 | _currentIndex = _digits.size() - 1; |
| 381 | } else { |
| 382 | findEmptyAndPerform([&](int i) { _currentIndex = i; }); |
| 383 | } |
| 384 | } |
| 385 | unfocusAll(_currentIndex); |
| 386 | } |
| 387 | |
| 388 | } // namespace Ui |