mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-30 07:07:25 +00:00
Rename ModelHandle to SharedModel
This patch is mostly a rename now, but also contains a few small cleanups. SharedModel implements the Model trait itself and gracefully falls back to an empty model is no Model was provided. This allows for some small simplifications. Also make sure to use the same comparision for SharedModels everywhere. This fixes the last remaining clippy errors we had.
This commit is contained in:
parent
afb3f269c1
commit
018c1a6666
22 changed files with 88 additions and 112 deletions
|
@ -20,7 +20,7 @@ fn main() {
|
|||
// ANCHOR: game_logic
|
||||
// Assign the shuffled Vec to the model property
|
||||
let tiles_model = std::rc::Rc::new(sixtyfps::VecModel::from(tiles));
|
||||
main_window.set_memory_tiles(sixtyfps::ModelHandle::new(tiles_model.clone()));
|
||||
main_window.set_memory_tiles(sixtyfps::ModelRc::new(tiles_model.clone()));
|
||||
|
||||
let main_window_weak = main_window.as_weak();
|
||||
main_window.on_check_if_pair_solved(move || {
|
||||
|
|
|
@ -20,7 +20,7 @@ fn main() {
|
|||
|
||||
// Assign the shuffled Vec to the model property
|
||||
let tiles_model = std::rc::Rc::new(sixtyfps::VecModel::from(tiles));
|
||||
main_window.set_memory_tiles(sixtyfps::ModelHandle::new(tiles_model));
|
||||
main_window.set_memory_tiles(sixtyfps::ModelRc::new(tiles_model));
|
||||
|
||||
main_window.run();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue