MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / setDigit

Method setDigit

Telegram/SourceFiles/intro/intro_code_input.cpp:90–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void CodeDigit::setDigit(int digit) {
91 if ((_dataDigit == digit) && _animation.animating()) {
92 return;
93 }
94 _dataDigit = digit;
95 if (_viewDigit != digit) {
96 _animation.stop();
97 if (digit == kDigitNone) {
98 _animation.start([=](float64 value) {
99 update();
100 if (!value) {
101 _viewDigit = digit;
102 }
103 }, 1., 0., st::universalDuration);
104 } else {
105 _viewDigit = digit;
106 _animation.start([=] { update(); }, 0, 1., st::universalDuration);
107 }
108 }
109}
110
111int CodeDigit::digit() const {
112 return _dataDigit;

Callers 4

setCodeMethod · 0.80
clearMethod · 0.80
keyPressEventMethod · 0.80
processDigitMethod · 0.80

Calls 4

updateFunction · 0.50
animatingMethod · 0.45
stopMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected