mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-30 15:17:25 +00:00
Rename more occurences
This commit is contained in:
parent
a0d89c0346
commit
d4c1130130
17 changed files with 22 additions and 24 deletions
|
@ -34,11 +34,11 @@ slint_target_sources(memory_game memory.slint)
|
|||
This should look familiar to people familiar with CMake. We see that this CMakeLists.txt
|
||||
references a `main.cpp`, which we will add later, and it also has a line
|
||||
`slint_target_sources(memory_game memory.slint)`, which is a Slint function used to
|
||||
add the `memory.60` file to the target. We must then create, in the same directory,
|
||||
the `memory.60` file. Let's just fill it with a hello world for now:
|
||||
add the `memory.slint` file to the target. We must then create, in the same directory,
|
||||
the `memory.slint` file. Let's just fill it with a hello world for now:
|
||||
|
||||
```slint
|
||||
{{#include memory.60:main_window}}
|
||||
{{#include memory.slint:main_window}}
|
||||
```
|
||||
|
||||
What's still missing is the `main.cpp`:
|
||||
|
@ -47,7 +47,7 @@ What's still missing is the `main.cpp`:
|
|||
{{#include main_initial.cpp:main}}
|
||||
```
|
||||
|
||||
To recap, we now have a directory with a `CMakeLists.txt`, `memory.60` and `main.cpp`.
|
||||
To recap, we now have a directory with a `CMakeLists.txt`, `memory.slint` and `main.cpp`.
|
||||
|
||||
We can now compile and run this program:
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// clang-format off
|
||||
// main.cpp
|
||||
|
||||
#include "memory_game_logic.h" // generated header from memory_game_logic.60
|
||||
#include "memory_game_logic.h" // generated header from memory_game_logic.slint
|
||||
|
||||
#include <random> // Added
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// ANCHOR: main
|
||||
// main.cpp
|
||||
|
||||
#include "memory.h" // generated header from memory.60
|
||||
#include "memory.h" // generated header from memory.slint
|
||||
|
||||
int main()
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
// main.cpp
|
||||
|
||||
#include "memory_tiles_from_cpp.h" // generated header from memory_tiles_from_cpp.60
|
||||
#include "memory_tiles_from_cpp.h" // generated header from memory_tiles_from_cpp.slint
|
||||
// ANCHOR: main
|
||||
// ...
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: (GPL-3.0-only OR LicenseRef-SixtyFPS-commercial)
|
||||
|
||||
// ANCHOR: main_window
|
||||
// memory.60
|
||||
// memory.slint
|
||||
MainWindow := Window {
|
||||
Text {
|
||||
text: "hello world";
|
||||
|
|
|
@ -16,7 +16,7 @@ more in detail:
|
|||
In order to make our tile extensible, the hard-coded icon name is replaced with an *icon*
|
||||
property that can be set from the outside when instantiating the element. For the final polish, we add a
|
||||
*solved* property that we use to animate the color to a shade of green when we've found a pair, later. We
|
||||
replace the code inside the `memory.60` file with the following:
|
||||
replace the code inside the `memory.slint` file with the following:
|
||||
|
||||
```slint
|
||||
{{#include ../../rust/src/main_polishing_the_tile.rs:tile}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue