mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
53 lines
1.9 KiB
Text
53 lines
1.9 KiB
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 */
|
|
|
|
|
|
WithStates := Rectangle {
|
|
property <brush> extra_background;
|
|
property <bool> condition;
|
|
background: yellow;
|
|
// ^error{The binding for the property 'background' is part of a binding loop} //FIXME: ideally we'd keep the span within the state
|
|
states [
|
|
xxx when condition : {
|
|
background: extra_background;
|
|
}
|
|
]
|
|
}
|
|
|
|
Test := Rectangle {
|
|
|
|
property <int> a: 45 + root.b;
|
|
// ^error{The binding for the property 'a' is part of a binding loop}
|
|
property <float> b: root.c;
|
|
// ^error{The binding for the property 'b' is part of a binding loop}
|
|
property <int> c <=> d;
|
|
// ^error{The binding for the property 'c' is part of a binding loop}
|
|
property <int> d: root.a + root.e;
|
|
// ^error{The binding for the property 'd' is part of a binding loop}
|
|
property <int> e: root.b; // FIXME: should we report an error here as well?
|
|
|
|
property <int> w: root.a + root.b; // This id not part of a loopµ
|
|
|
|
property<bool> cond: xx.x == 0;
|
|
// ^error{The binding for the property 'cond' is part of a binding loop}
|
|
|
|
xx := Rectangle {
|
|
x: y;
|
|
// ^error{The binding for the property 'x' is part of a binding loop}
|
|
y: root.cond ? 42px : 55px;
|
|
// ^error{The binding for the property 'y' is part of a binding loop}
|
|
}
|
|
|
|
WithStates {
|
|
extra_background: background;
|
|
// ^error{The binding for the property 'extra_background' is part of a binding loop}
|
|
}
|
|
}
|
|
|