| 310 | } |
| 311 | |
| 312 | void Widget::checkUpdateStatus() { |
| 313 | Expects(!Core::UpdaterDisabled()); |
| 314 | |
| 315 | if (Core::UpdateChecker().state() == Core::UpdateChecker::State::Ready) { |
| 316 | if (_update) return; |
| 317 | _update.create( |
| 318 | this, |
| 319 | object_ptr<Ui::RoundButton>( |
| 320 | this, |
| 321 | tr::lng_menu_update(), |
| 322 | st::defaultBoxButton)); |
| 323 | _update->entity()->setTextTransform(Ui::RoundButtonTextTransform::ToUpper); |
| 324 | if (!_showAnimation) { |
| 325 | _update->setVisible(true); |
| 326 | } |
| 327 | const auto stepHasCover = getStep()->hasCover(); |
| 328 | _update->toggle(!stepHasCover, anim::type::instant); |
| 329 | _update->entity()->setClickedCallback([] { |
| 330 | Core::checkReadyUpdate(); |
| 331 | Core::Restart(); |
| 332 | }); |
| 333 | } else { |
| 334 | if (!_update) return; |
| 335 | _update.destroy(); |
| 336 | } |
| 337 | updateControlsGeometry(); |
| 338 | } |
| 339 | |
| 340 | void Widget::setInnerFocus() { |
| 341 | if (getStep()->animating()) { |
nothing calls this directly
no test coverage detected