mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-03 13:23:00 +00:00
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
45 lines
1 KiB
Text
45 lines
1 KiB
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
|
|
|
TextComponent := GridLayout {
|
|
property<bool> has_focus: my_text_input.has_focus;
|
|
forward-focus: my_text_input;
|
|
Row {
|
|
my_text_input := TextInput { }
|
|
}
|
|
}
|
|
|
|
TestCase := Rectangle {
|
|
width: 400phx;
|
|
height: 400phx;
|
|
forward-focus: input2;
|
|
|
|
input1 := TextComponent {
|
|
}
|
|
input2 := TextComponent {
|
|
}
|
|
|
|
property<bool> input1_focused: input1.has_focus;
|
|
property<bool> input2_focused: input2.has_focus;
|
|
}
|
|
|
|
/*
|
|
```rust
|
|
let instance = TestCase::new().unwrap();
|
|
assert!(!instance.get_input1_focused());
|
|
assert!(instance.get_input2_focused());
|
|
```
|
|
|
|
```cpp
|
|
auto handle = TestCase::create();
|
|
const TestCase &instance = *handle;
|
|
assert(!instance.get_input1_focused());
|
|
assert(instance.get_input2_focused());
|
|
```
|
|
|
|
```js
|
|
var instance = new slint.TestCase();
|
|
assert(!instance.input1_focused);
|
|
assert(instance.input2_focused);
|
|
```
|
|
*/
|