mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 14:45:08 +00:00
Minesweeper: Fix lag when changing the field size.
Use a number of techniques to avoid freezing the UI for too long. - Keep reusing the same widgets for the squares once they've been created. - Temporarily disable widget updates. - Avoid some redundant work on each run of reset().
This commit is contained in:
parent
49d0cdabac
commit
13b8c7eab8
2 changed files with 43 additions and 27 deletions
|
@ -77,6 +77,9 @@ int main(int argc, char** argv)
|
|||
game_menu->add_action(GAction::create("Expert", { Mod_Ctrl, Key_E }, [field] (const GAction&) {
|
||||
field->set_field_size(16, 30, 99);
|
||||
}));
|
||||
game_menu->add_action(GAction::create("Madwoman", { Mod_Ctrl, Key_M }, [field] (const GAction&) {
|
||||
field->set_field_size(32, 60, 350);
|
||||
}));
|
||||
menubar->add_menu(move(game_menu));
|
||||
|
||||
auto help_menu = make<GMenu>("Help");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue