mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 22:31:14 +00:00
51 lines
1.5 KiB
Text
51 lines
1.5 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 */
|
|
|
|
import { StandardButton } from "sixtyfps_widgets.60";
|
|
|
|
MyDiag1 := Dialog {
|
|
Rectangle {}
|
|
StandardButton { kind: cancel; }
|
|
Rectangle {}
|
|
// ^error{A Dialog can have only one child element that is not a StandardButton}
|
|
}
|
|
|
|
MyDiag2 := Dialog {
|
|
StandardButton { kind: reset; }
|
|
StandardButton {
|
|
kind: cancel;
|
|
col: 42;
|
|
// ^error{col used outside of a GridLayout}
|
|
rowspan: 2;
|
|
// ^error{rowspan used outside of a GridLayout}
|
|
}
|
|
}
|
|
|
|
MyDiag3 := Dialog {
|
|
Rectangle { }
|
|
StandardButton { kind: ok; }
|
|
StandardButton { }
|
|
// ^error{The `kind` property of the StandardButton in a Dialog must be set}
|
|
StandardButton { kind: true ? ok : cancel; }
|
|
// ^error{The `kind` property of the StandardButton in a Dialog must be known at compile-time}
|
|
StandardButton { kind: ok; }
|
|
// ^error{Duplicated `kind`: There are two StandardButton in this Dialog with the same kind}
|
|
|
|
}
|
|
|
|
|
|
Test := Rectangle {
|
|
MyDiag1 {}
|
|
MyDiag2 {} // FIXME: not the best place for the error
|
|
// ^error{A Dialog must have a single child element that is not StandardButton}
|
|
MyDiag3 {}
|
|
}
|
|
|
|
|