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:
parent
cfc3a2ebac
commit
15f0ee1727
3 changed files with 8 additions and 21 deletions
|
@ -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));
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue