mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 05:44:52 +00:00
C++ tutorial: Fix code formatting
... to avoid a horizontal scrollbar in the code block. Apply the same formatting tricks as on the HTML blog version
This commit is contained in:
parent
82403c120b
commit
ef36caad88
1 changed files with 14 additions and 9 deletions
|
@ -7,6 +7,7 @@
|
|||
This file is also available under commercial licensing terms.
|
||||
Please contact info@sixtyfps.io for more information.
|
||||
LICENSE END */
|
||||
// clang-format off
|
||||
// main.cpp
|
||||
|
||||
#include "memory_game_logic.h" // generated header from memory_game_logic.60
|
||||
|
@ -49,23 +50,27 @@ int main()
|
|||
bool is_pair_solved = tile == first_visible_tile;
|
||||
if (is_pair_solved) {
|
||||
first_visible_tile.solved = true;
|
||||
tiles_model->set_row_data(first_visible_index, first_visible_tile);
|
||||
tiles_model->set_row_data(first_visible_index,
|
||||
first_visible_tile);
|
||||
tile.solved = true;
|
||||
tiles_model->set_row_data(i, tile);
|
||||
return;
|
||||
}
|
||||
main_window->set_disable_tiles(true);
|
||||
|
||||
sixtyfps::Timer::single_shot(std::chrono::seconds(1), [=]() mutable {
|
||||
main_window->set_disable_tiles(false);
|
||||
first_visible_tile.image_visible = false;
|
||||
tiles_model->set_row_data(first_visible_index, first_visible_tile);
|
||||
tile.image_visible = false;
|
||||
tiles_model->set_row_data(i, tile);
|
||||
});
|
||||
sixtyfps::Timer::single_shot(std::chrono::seconds(1),
|
||||
[=]() mutable {
|
||||
main_window->set_disable_tiles(false);
|
||||
first_visible_tile.image_visible = false;
|
||||
tiles_model->set_row_data(first_visible_index,
|
||||
first_visible_tile);
|
||||
tile.image_visible = false;
|
||||
tiles_model->set_row_data(i, tile);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
main_window->run();
|
||||
}
|
||||
// ANCHOR_END: game_logic
|
||||
// ANCHOR_END: game_logic
|
||||
// clang-format on
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue