1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:37:35 +00:00

Solitaire: Replace self-owned timer with Core::Object's timer

This is just a bit nicer than owning a separate timer in the Solitaire
application because LibCore will prevent timer events from firing when
e.g. the window is not visible. Therefore SolitaireWidget doesn't need
need to check for such conditions.
This commit is contained in:
Timothy Flynn 2021-05-04 23:00:53 -04:00 committed by Andreas Kling
parent cfc3a2ebac
commit 15f0ee1727
3 changed files with 8 additions and 21 deletions

View file

@ -39,7 +39,7 @@ int main(int argc, char** argv)
window->set_resizable(false);
window->resize(SolitaireWidget::width, SolitaireWidget::height);
auto widget = SolitaireWidget::construct(window, [&](uint32_t score) {
auto widget = SolitaireWidget::construct([&](uint32_t score) {
window->set_title(String::formatted("Score: {} - Solitaire", score));
});