slint/tests/cases/layout/issue_553_materialized_init.60
Olivier Goffart cc0d5e17a1 Fix materialized property being wrongly re-initilized when used within the same Element
Because the `bindings` field is taken in order not to keep the Element borrowed.

Fixes original report from #553
2021-10-07 09:23:24 +02:00

42 lines
1,018 B
Text

/* LICENSE BEGIN
This file is part of the SixtyFPS Project -- https://sixtyfps.io
Copyright (c) 2021 Olivier Goffart <olivier.goffart@sixtyfps.io>
Copyright (c) 2021 Simon Hausmann <simon.hausmann@sixtyfps.io>
SPDX-License-Identifier: GPL-3.0-only
This file is also available under commercial licensing terms.
Please contact info@sixtyfps.io for more information.
LICENSE END */
// Test the propagation of maximum and minimum size through nested grid layouts
TestCase := Rectangle {
min-width: 500px;
max-width: min-width;
property xxx <=> preferred-height;
HorizontalLayout {
Rectangle { height: 88px; }
}
property <bool> test: min-width == 500px && max-width == 500px && xxx == 88px;
}
/*
```cpp
auto handle = TestCase::create();
const TestCase &instance = *handle;
assert(instance.get_test());
```
```rust
let instance = TestCase::new();
assert!(instance.get_test());
```
```js
var instance = new sixtyfps.TestCase({});
assert(instance.test);
```
*/