mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-02 21:03:00 +00:00
First stage of cleaning up the export handling of the slint root component (#2095)
We implicitly export the last component of a .slint file to the generator. Issue a warning when that happens and suggest to export it explicitly.
This commit is contained in:
parent
33d68687c2
commit
24dcef5fed
130 changed files with 175 additions and 143 deletions
|
|
@ -5,7 +5,7 @@ import { Carousel } from "carousel.slint";
|
||||||
import { Card } from "card.slint";
|
import { Card } from "card.slint";
|
||||||
import { Theme } from "theme.slint";
|
import { Theme } from "theme.slint";
|
||||||
|
|
||||||
component MainWindow inherits Window {
|
export component MainWindow inherits Window {
|
||||||
private property<[{ title: string, image: image}]> navigation-items: [
|
private property<[{ title: string, image: image}]> navigation-items: [
|
||||||
{ title: "Settings", image: @image-url("svg/settings_black.svg") },
|
{ title: "Settings", image: @image-url("svg/settings_black.svg") },
|
||||||
{ title: "Home", image: @image-url("svg/home_black.svg") },
|
{ title: "Home", image: @image-url("svg/home_black.svg") },
|
||||||
|
|
@ -38,4 +38,4 @@ component MainWindow inherits Window {
|
||||||
clicked => { root.selected-index = index; }
|
clicked => { root.selected-index = index; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
global GallerySettings {
|
export global GallerySettings {
|
||||||
in property<bool> widgets-disabled: false;
|
in property<bool> widgets-disabled: false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
import { ScrollView, Button, CheckBox, SpinBox, Slider, GroupBox, LineEdit, StandardListView,
|
import { ScrollView, Button, CheckBox, SpinBox, Slider, GroupBox, LineEdit, StandardListView,
|
||||||
ComboBox, HorizontalBox, VerticalBox, GridBox, TabWidget, TextEdit, AboutSixtyFPS } from "std-widgets.slint";
|
ComboBox, HorizontalBox, VerticalBox, GridBox, TabWidget, TextEdit, AboutSixtyFPS } from "std-widgets.slint";
|
||||||
|
|
||||||
component App inherits Window {
|
export component App inherits Window {
|
||||||
preferred-width: 500px;
|
preferred-width: 500px;
|
||||||
preferred-height: 600px;
|
preferred-height: 600px;
|
||||||
title: "Slint OpenGL Underlay Example";
|
title: "Slint OpenGL Underlay Example";
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
import { SpinBox, Button, CheckBox, Slider, GroupBox, StandardListView, GridBox } from "std-widgets.slint";
|
import { SpinBox, Button, CheckBox, Slider, GroupBox, StandardListView, GridBox } from "std-widgets.slint";
|
||||||
import { Label, Page, Preview } from "common.slint";
|
import { Label, Page, Preview } from "common.slint";
|
||||||
|
|
||||||
component PrintPage inherits Page {
|
export component PrintPage inherits Page {
|
||||||
|
|
||||||
layout := GridLayout {
|
layout := GridLayout {
|
||||||
padding-left: 40px;
|
padding-left: 40px;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ struct InkLevel {
|
||||||
level: float,
|
level: float,
|
||||||
}
|
}
|
||||||
|
|
||||||
component MainWindow inherits Window {
|
export component MainWindow inherits Window {
|
||||||
callback quit();
|
callback quit();
|
||||||
|
|
||||||
width: 800px;
|
width: 800px;
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ pub struct UsedSubTypes {
|
||||||
/// Or is materialized for repeated expression.
|
/// Or is materialized for repeated expression.
|
||||||
#[derive(Default, Debug)]
|
#[derive(Default, Debug)]
|
||||||
pub struct Component {
|
pub struct Component {
|
||||||
// node: SyntaxNode,
|
pub node: Option<SyntaxNode>,
|
||||||
pub id: String,
|
pub id: String,
|
||||||
pub root_element: ElementRc,
|
pub root_element: ElementRc,
|
||||||
|
|
||||||
|
|
@ -254,6 +254,7 @@ impl Component {
|
||||||
let mut child_insertion_point = None;
|
let mut child_insertion_point = None;
|
||||||
let is_legacy_syntax = node.child_token(SyntaxKind::ColonEqual).is_some();
|
let is_legacy_syntax = node.child_token(SyntaxKind::ColonEqual).is_some();
|
||||||
let c = Component {
|
let c = Component {
|
||||||
|
node: Some(node.clone().into()),
|
||||||
id: parser::identifier_text(&node.DeclaredIdentifier()).unwrap_or_default(),
|
id: parser::identifier_text(&node.DeclaredIdentifier()).unwrap_or_default(),
|
||||||
root_element: Element::from_node(
|
root_element: Element::from_node(
|
||||||
node.Element(),
|
node.Element(),
|
||||||
|
|
@ -2215,6 +2216,15 @@ impl Exports {
|
||||||
|
|
||||||
if sorted_deduped_exports.is_empty() {
|
if sorted_deduped_exports.is_empty() {
|
||||||
if let Some(last_compo) = inner_components.last() {
|
if let Some(last_compo) = inner_components.last() {
|
||||||
|
if last_compo.is_global() {
|
||||||
|
diag.push_warning(
|
||||||
|
"Global singleton is implicitly marked for export. This is deprecated and it should be explicitly exported"
|
||||||
|
.into(),
|
||||||
|
&last_compo.node,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
diag.push_warning("Component is implicitly marked for export. This is deprecated and it should be explicitly exported".into(), &last_compo.node)
|
||||||
|
}
|
||||||
let name = last_compo.id.clone();
|
let name = last_compo.id.clone();
|
||||||
sorted_deduped_exports.push((
|
sorted_deduped_exports.push((
|
||||||
ExportedName { name, name_ident: doc.clone().into() },
|
ExportedName { name, name_ident: doc.clone().into() },
|
||||||
|
|
|
||||||
|
|
@ -268,6 +268,7 @@ fn duplicate_sub_component(
|
||||||
) -> Rc<Component> {
|
) -> Rc<Component> {
|
||||||
debug_assert!(component_to_duplicate.parent_element.upgrade().is_some());
|
debug_assert!(component_to_duplicate.parent_element.upgrade().is_some());
|
||||||
let new_component = Component {
|
let new_component = Component {
|
||||||
|
node: component_to_duplicate.node.clone(),
|
||||||
id: component_to_duplicate.id.clone(),
|
id: component_to_duplicate.id.clone(),
|
||||||
root_element: duplicate_element_with_mapping(
|
root_element: duplicate_element_with_mapping(
|
||||||
&component_to_duplicate.root_element,
|
&component_to_duplicate.root_element,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ Button3 := Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Test := Window {
|
export Test := Window {
|
||||||
|
|
||||||
Button1 { }
|
Button1 { }
|
||||||
Button1 { accessible-description: "ok"; } // ok because Button1 has a role
|
Button1 { accessible-description: "ok"; } // ok because Button1 has a role
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ WithStates := Rectangle {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
Test := Rectangle {
|
export Test := Rectangle {
|
||||||
|
|
||||||
property <int> a: 45 + root.b;
|
property <int> a: 45 + root.b;
|
||||||
// ^error{The binding for the property 'a' is part of a binding loop}
|
// ^error{The binding for the property 'a' is part of a binding loop}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ T4 := Rectangle {
|
||||||
property <length> my_property <=> x;
|
property <length> my_property <=> x;
|
||||||
}
|
}
|
||||||
|
|
||||||
App := Rectangle {
|
export App := Rectangle {
|
||||||
|
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ Compo1 := Rectangle {
|
||||||
// ^error{The binding for the property 'bb' is part of a binding loop}
|
// ^error{The binding for the property 'bb' is part of a binding loop}
|
||||||
}
|
}
|
||||||
|
|
||||||
App := Rectangle {
|
export App := Rectangle {
|
||||||
cc := Compo1 {
|
cc := Compo1 {
|
||||||
aa() => { return self.a; }
|
aa() => { return self.a; }
|
||||||
// ^error{The binding for the property 'aa' is part of a binding loop}
|
// ^error{The binding for the property 'aa' is part of a binding loop}
|
||||||
|
|
@ -29,4 +29,4 @@ App := Rectangle {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ Alias := Rectangle {
|
||||||
property <int> ps_width <=> viewport_width;
|
property <int> ps_width <=> viewport_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
Foo := Rectangle {
|
export Foo := Rectangle {
|
||||||
property <int> base-prop: alias.viewport_width;
|
property <int> base-prop: alias.viewport_width;
|
||||||
// ^error{The binding for the property 'base-prop' is part of a binding loop}
|
// ^error{The binding for the property 'base-prop' is part of a binding loop}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ TC := Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Test := Rectangle {
|
export Test := Rectangle {
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop} // FIXME: That's an internal property, but people might understand
|
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop} // FIXME: That's an internal property, but people might understand
|
||||||
// ^^error{The binding for the property 'min-width' is part of a binding loop}
|
// ^^error{The binding for the property 'min-width' is part of a binding loop}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ Wrap := Rectangle {
|
||||||
property <bool> test: square.width == square.height;
|
property <bool> test: square.width == square.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
Test := Rectangle {
|
export Test := Rectangle {
|
||||||
property <image> source;
|
property <image> source;
|
||||||
GridLayout {
|
GridLayout {
|
||||||
// ^error{The binding for the property 'layout-cache-h' is part of a binding loop}
|
// ^error{The binding for the property 'layout-cache-h' is part of a binding loop}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ Compo := Rectangle {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Foo := Rectangle {
|
export Foo := Rectangle {
|
||||||
Compo {
|
Compo {
|
||||||
// ^error{The binding for the property 'preferred-width' is part of a binding loop}
|
// ^error{The binding for the property 'preferred-width' is part of a binding loop}
|
||||||
the_text: self.preferred-width / 1px;
|
the_text: self.preferred-width / 1px;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
Key := Rectangle { property <int> pos; property <int> num_elements; }
|
Key := Rectangle { property <int> pos; property <int> num_elements; }
|
||||||
|
|
||||||
Test := Rectangle {
|
export Test := Rectangle {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
property <int> num_elements;
|
property <int> num_elements;
|
||||||
num-elements: 4;
|
num-elements: 4;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
|
|
||||||
animate x {
|
animate x {
|
||||||
duration: 1000ms;
|
duration: 1000ms;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
property<duration> p1: 3s + 1ms;
|
property<duration> p1: 3s + 1ms;
|
||||||
property<int> p2: 3s + 1;
|
property<int> p2: 3s + 1;
|
||||||
// ^error{Cannot convert float to duration}
|
// ^error{Cannot convert float to duration}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
Test := Window {
|
export Test := Window {
|
||||||
a: [,];
|
a: [,];
|
||||||
// ^error{invalid expression}
|
// ^error{invalid expression}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
TouchArea {
|
TouchArea {
|
||||||
clicked => { root.x = 1phx; }
|
clicked => { root.x = 1phx; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ Foo := Rectangle {
|
||||||
drop-shadow-color: red;
|
drop-shadow-color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
SuperSimple := Window {
|
export SuperSimple := Window {
|
||||||
drop-shadow-color: #00000080;
|
drop-shadow-color: #00000080;
|
||||||
// ^warning{The drop-shadow-color property cannot be used on the root element, the shadow will not be visible}
|
// ^warning{The drop-shadow-color property cannot be used on the root element, the shadow will not be visible}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ TestBox2 := Rectangle {
|
||||||
// ^error{The @children placeholder can only appear once in an element hierarchy}
|
// ^error{The @children placeholder can only appear once in an element hierarchy}
|
||||||
}
|
}
|
||||||
|
|
||||||
Final := TestBox {
|
export Final := TestBox {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@children
|
@children
|
||||||
// ^error{children placeholder not allowed in the final component}
|
// ^error{children placeholder not allowed in the final component}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
Final := Window {
|
export Final := Window {
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
@children
|
@children
|
||||||
// ^error{children placeholder not allowed in the final component}
|
// ^error{children placeholder not allowed in the final component}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
MyTouchArea := TouchArea { }
|
MyTouchArea := TouchArea { }
|
||||||
|
|
||||||
SubElements := Rectangle {
|
export SubElements := Rectangle {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
clip: 42;
|
clip: 42;
|
||||||
// ^error{Cannot convert float to bool}
|
// ^error{Cannot convert float to bool}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
// comment
|
// comment
|
||||||
|
|
||||||
// line comment
|
// line comment
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
/* block comment */
|
/* block comment */
|
||||||
background: green;
|
background: green;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
property<bool> zz: aa > bb == cc
|
property<bool> zz: aa > bb == cc
|
||||||
// ^error{Use parentheses to disambiguate equality expression on the same level}
|
// ^error{Use parentheses to disambiguate equality expression on the same level}
|
||||||
< dd;
|
< dd;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ SuperSimple := Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Test2 := Rectangle {
|
export Test2 := Rectangle {
|
||||||
background: {
|
background: {
|
||||||
// ^error{Cannot convert void to brush}
|
// ^error{Cannot convert void to brush}
|
||||||
if (true) {
|
if (true) {
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ MyDialog4 := Dialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Test := Rectangle {
|
export Test := Rectangle {
|
||||||
MyDiag1 {}
|
MyDiag1 {}
|
||||||
MyDiag2 {}
|
MyDiag2 {}
|
||||||
MyDiag3 {}
|
MyDiag3 {}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
import { StandardButton } from "std-widgets.slint";
|
import { StandardButton } from "std-widgets.slint";
|
||||||
|
|
||||||
Test := Dialog {
|
export Test := Dialog {
|
||||||
// ^error{A Dialog must have a single child element that is not StandardButton}
|
// ^error{A Dialog must have a single child element that is not StandardButton}
|
||||||
StandardButton { kind: ok; }
|
StandardButton { kind: ok; }
|
||||||
StandardButton { }
|
StandardButton { }
|
||||||
// ^error{The `kind` property of the StandardButton in a Dialog must be set}
|
// ^error{The `kind` property of the StandardButton in a Dialog must be set}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
|
|
||||||
x: 42phx;
|
x: 42phx;
|
||||||
x: 32phx;
|
x: 32phx;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
background: green;
|
background: green;
|
||||||
background: red;
|
background: red;
|
||||||
// ^error{Duplicated property}
|
// ^error{Duplicated property}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ SubElement := Rectangle {
|
||||||
// ^error{duplicated element id 'hello'}
|
// ^error{duplicated element id 'hello'}
|
||||||
}
|
}
|
||||||
|
|
||||||
TestCase := Rectangle {
|
export TestCase := Rectangle {
|
||||||
|
|
||||||
unique := Rectangle {
|
unique := Rectangle {
|
||||||
foo := SubElement { }
|
foo := SubElement { }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
animate x { easing: ease-in; }
|
animate x { easing: ease-in; }
|
||||||
animate y { easing: foo; }
|
animate y { easing: foo; }
|
||||||
// ^error{Unknown unqualified identifier 'foo'}
|
// ^error{Unknown unqualified identifier 'foo'}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
// Cannot be put in the easing.slint test because it is in a different pass
|
// Cannot be put in the easing.slint test because it is in a different pass
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
property <int> g; animate g { easing: cubic-bezier; }
|
property <int> g; animate g { easing: cubic-bezier; }
|
||||||
// ^error{must be called}
|
// ^error{must be called}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
background: green;
|
background: green;
|
||||||
|
|
||||||
for xx Text {}
|
for xx Text {}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
SubElements := Rectangle {
|
export SubElements := Rectangle {
|
||||||
|
|
||||||
background: blue;
|
background: blue;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ Inline1 := Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SubElements := Rectangle {
|
export SubElements := Rectangle {
|
||||||
Inline1 {
|
Inline1 {
|
||||||
background: yellow;
|
background: yellow;
|
||||||
invalid: yellow;
|
invalid: yellow;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ Comp := Rectangle {
|
||||||
// ^error{'Rectangle' is not a valid type}
|
// ^error{'Rectangle' is not a valid type}
|
||||||
}
|
}
|
||||||
|
|
||||||
Foo := Rectangle {
|
export Foo := Rectangle {
|
||||||
xx := Rectangle { }
|
xx := Rectangle { }
|
||||||
Comp {
|
Comp {
|
||||||
r: xx;
|
r: xx;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
|
|
||||||
lay := GridLayout {
|
lay := GridLayout {
|
||||||
property<string> foo: "hello";
|
property<string> foo: "hello";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
|
|
||||||
lay := GridLayout {
|
lay := GridLayout {
|
||||||
property<string> foo: "hello";
|
property<string> foo: "hello";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
property<brush> g1: @linear-gradient();
|
property<brush> g1: @linear-gradient();
|
||||||
// ^error{Expected angle expression}
|
// ^error{Expected angle expression}
|
||||||
property<brush> g2: @linear-gradient(to left, blue, red);
|
property<brush> g2: @linear-gradient(to left, blue, red);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ global Plop := {
|
||||||
// ^error{Builtin function must be called}
|
// ^error{Builtin function must be called}
|
||||||
}
|
}
|
||||||
|
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
property <int> a: max + max() + max(45, "hello");
|
property <int> a: max + max() + max(45, "hello");
|
||||||
// ^error{Builtin function must be called}
|
// ^error{Builtin function must be called}
|
||||||
// ^^error{Needs at least one argument}
|
// ^^error{Needs at least one argument}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
H := Rectangle {
|
export H := Rectangle {
|
||||||
x: {foo: "42"};
|
x: {foo: "42"};
|
||||||
// ^error{Cannot convert \{ foo: string,\} to length}
|
// ^error{Cannot convert \{ foo: string,\} to length}
|
||||||
y: [ 45, 45, 45, 45 ];
|
y: [ 45, 45, 45, 45 ];
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
SuperSimple := Window {
|
export SuperSimple := Window {
|
||||||
|
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
// ^warning{The opacity property cannot be used on the root element, it will not be applied}
|
// ^warning{The opacity property cannot be used on the root element, it will not be applied}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
88;
|
88;
|
||||||
// ^error{Parse error}
|
// ^error{Parse error}
|
||||||
* / - + // no error there as this is already reported in the previous line
|
* / - + // no error there as this is already reported in the previous line
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
TestCase := Rectangle {
|
export TestCase := Rectangle {
|
||||||
Path {
|
Path {
|
||||||
LineTo { x: 100; y: 0; }
|
LineTo { x: 100; y: 0; }
|
||||||
LineTo { x: 100; y: 0; }
|
LineTo { x: 100; y: 0; }
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ Test2 := Path {
|
||||||
// ^error{Error parsing SVG commands}
|
// ^error{Error parsing SVG commands}
|
||||||
}
|
}
|
||||||
|
|
||||||
TestCase := Rectangle {
|
export TestCase := Rectangle {
|
||||||
Path {
|
Path {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
TestCase := Rectangle {
|
export TestCase := Rectangle {
|
||||||
Path {
|
Path {
|
||||||
MoveTo {
|
MoveTo {
|
||||||
x: 0;
|
x: 0;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ Foo := Rectangle {
|
||||||
// ^error{conversion from percentage to length is only possible for the properties width and height}
|
// ^error{conversion from percentage to length is only possible for the properties width and height}
|
||||||
}
|
}
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
height: 30%;
|
height: 30%;
|
||||||
// ^error{Cannot find parent property to apply relative length}
|
// ^error{Cannot find parent property to apply relative length}
|
||||||
Foo {
|
Foo {
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
X := PopupWindow {
|
export X := PopupWindow {
|
||||||
// ^error{PopupWindow cannot be the top level}
|
// ^error{PopupWindow cannot be the top level}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
TestCase := Rectangle {
|
export TestCase := Rectangle {
|
||||||
animate x {
|
animate x {
|
||||||
duration: 1000ms;
|
duration: 1000ms;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ Comp := Rectangle {
|
||||||
callback pressed;
|
callback pressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
Test := Comp {
|
export Test := Comp {
|
||||||
property<int> foo;
|
property<int> foo;
|
||||||
foo: 100;
|
foo: 100;
|
||||||
property<NonExistent> bar;
|
property<NonExistent> bar;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ Comp := Rectangle {
|
||||||
property<int> prop;
|
property<int> prop;
|
||||||
}
|
}
|
||||||
|
|
||||||
Test := Rectangle {
|
export Test := Rectangle {
|
||||||
Comp {
|
Comp {
|
||||||
prop: 45;
|
prop: 45;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
property<brush> g1: @radial-gradient();
|
property<brush> g1: @radial-gradient();
|
||||||
// ^error{Expected 'circle': currently, only @radial-gradient\(circle, ...\) are supported}
|
// ^error{Expected 'circle': currently, only @radial-gradient\(circle, ...\) are supported}
|
||||||
property<brush> g2: @radial-gradient(circle at 100%, #333, #333 50%, #eee 75%, #333 75%);
|
property<brush> g2: @radial-gradient(circle at 100%, #333, #333 50%, #eee 75%, #333 75%);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
background: {
|
background: {
|
||||||
return 42;
|
return 42;
|
||||||
// ^error{Cannot convert float to brush}
|
// ^error{Cannot convert float to brush}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ Ex2 := Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Ex3 := Rectangle {
|
export Ex3 := Rectangle {
|
||||||
i1 := Image {
|
i1 := Image {
|
||||||
// ^error{Elements with rotation properties cannot have children elements}
|
// ^error{Elements with rotation properties cannot have children elements}
|
||||||
Rectangle {}
|
Rectangle {}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
TouchArea {
|
TouchArea {
|
||||||
clicked => { root.x += 1phx; }
|
clicked => { root.x += 1phx; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ Base := Rectangle {
|
||||||
callback blah;
|
callback blah;
|
||||||
}
|
}
|
||||||
|
|
||||||
SubElements := Rectangle {
|
export SubElements := Rectangle {
|
||||||
callback foobar;
|
callback foobar;
|
||||||
callback foobar;
|
callback foobar;
|
||||||
// ^error{Duplicated callback declaration}
|
// ^error{Duplicated callback declaration}
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ component NewSyntax {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
component OldInNewSyntax {
|
export component OldInNewSyntax {
|
||||||
property<bool> checked;
|
property<bool> checked;
|
||||||
property <int> border;
|
property <int> border;
|
||||||
property <color> color;
|
property <color> color;
|
||||||
|
|
@ -130,4 +130,4 @@ component OldInNewSyntax {
|
||||||
text := Text {}
|
text := Text {}
|
||||||
touch := TouchArea {}
|
touch := TouchArea {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
TestCase := Rectangle {
|
export TestCase := Rectangle {
|
||||||
property<bool> checked;
|
property<bool> checked;
|
||||||
property <int> border;
|
property <int> border;
|
||||||
animate background { }
|
animate background { }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
Test := Window {
|
export Test := Window {
|
||||||
Text {
|
Text {
|
||||||
text: "hel\lo";
|
text: "hel\lo";
|
||||||
// ^error{Cannot parse string literal}
|
// ^error{Cannot parse string literal}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
SubElements := Rectangle {
|
export SubElements := Rectangle {
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
background: yellow;
|
background: yellow;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,6 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
background: green;
|
background: green;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
TestCase := Rectangle {
|
export TestCase := Rectangle {
|
||||||
Path {
|
Path {
|
||||||
commands: "M 350 300 L 550 300 ";
|
commands: "M 350 300 L 550 300 ";
|
||||||
LineTo { x: 10; y: 100; }
|
LineTo { x: 10; y: 100; }
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ global MyType := {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
MyType {
|
MyType {
|
||||||
// ^error{Cannot create an instance of a global component}
|
// ^error{Cannot create an instance of a global component}
|
||||||
ccc: "hello";
|
ccc: "hello";
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
struct Struct := { def: int, }
|
struct Struct := { def: int, }
|
||||||
|
|
||||||
SuperSimple := Rectangle {
|
export SuperSimple := Rectangle {
|
||||||
DoesNotExist {
|
DoesNotExist {
|
||||||
// ^error{Unknown type DoesNotExist}
|
// ^error{Unknown type DoesNotExist}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ global Singleton := {
|
||||||
// ^error{A global component cannot have an 'init' callback}
|
// ^error{A global component cannot have an 'init' callback}
|
||||||
}
|
}
|
||||||
|
|
||||||
Test := Rectangle {
|
export Test := Rectangle {
|
||||||
callback init;
|
callback init;
|
||||||
// ^error{Cannot override callback 'init'}
|
// ^error{Cannot override callback 'init'}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ Foo := Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Bar := Rectangle {
|
export Bar := Rectangle {
|
||||||
Foo { Text {} }
|
Foo { Text {} }
|
||||||
ListView {
|
ListView {
|
||||||
Text {}
|
Text {}
|
||||||
|
|
@ -32,4 +32,4 @@ Bar := Rectangle {
|
||||||
for x in 2: Rectangle {}
|
for x in 2: Rectangle {}
|
||||||
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
|
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
import { TabWidget } from "std-widgets.slint";
|
import { TabWidget } from "std-widgets.slint";
|
||||||
Test1 := Rectangle {
|
export Test1 := Rectangle {
|
||||||
TabWidget {
|
TabWidget {
|
||||||
Rectangle {}
|
Rectangle {}
|
||||||
// ^error{Rectangle is not allowed within TabWidget. Only Tab are valid children}
|
// ^error{Rectangle is not allowed within TabWidget. Only Tab are valid children}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import { TabWidget } from "std-widgets.slint";
|
import { TabWidget } from "std-widgets.slint";
|
||||||
|
|
||||||
Test2 := Rectangle {
|
export Test2 := Rectangle {
|
||||||
TabWidget {
|
TabWidget {
|
||||||
Tab {
|
Tab {
|
||||||
visible: false;
|
visible: false;
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,5 @@ Test3 := Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Foo := TabWidget { }
|
export Foo := TabWidget { }
|
||||||
// ^error{Unknown type TabWidget. \(The type exist as an internal type, but cannot be accessed in this scope\)}
|
// ^error{Unknown type TabWidget. \(The type exist as an internal type, but cannot be accessed in this scope\)}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
component Button {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
component App {
|
||||||
|
//^warning{Component is implicitly marked for export. This is deprecated and it should be explicitly exported}
|
||||||
|
Button {}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
global Settings {
|
||||||
|
//^warning{Global singleton is implicitly marked for export. This is deprecated and it should be explicitly exported}
|
||||||
|
in-out property <bool> active;
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
forward-focus: nothingness;
|
forward-focus: nothingness;
|
||||||
// ^error{Unknown unqualified identifier}
|
// ^error{Unknown unqualified identifier}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
edit := TextInput { }
|
edit := TextInput { }
|
||||||
TouchArea {
|
TouchArea {
|
||||||
clicked => {
|
clicked => {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
forward-focus: someRect;
|
forward-focus: someRect;
|
||||||
// ^error{element is not focusable}
|
// ^error{element is not focusable}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ Abc := Rectangle {
|
||||||
function par() {}
|
function par() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
Xxx := Rectangle {
|
export Xxx := Rectangle {
|
||||||
function fooo(a: int, a: int) -> int { return a; }
|
function fooo(a: int, a: int) -> int { return a; }
|
||||||
// ^error{Duplicated argument name 'a'}
|
// ^error{Duplicated argument name 'a'}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ Comp := Rectangle {
|
||||||
public function f2() {}
|
public function f2() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
Xxx := Rectangle {
|
export Xxx := Rectangle {
|
||||||
function foo(a: int) -> string { return a; }
|
function foo(a: int) -> string { return a; }
|
||||||
|
|
||||||
comp := Comp {}
|
comp := Comp {}
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ Foo_Legacy := Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Bar_Legacy := Rectangle {
|
export Bar_Legacy := Rectangle {
|
||||||
pure callback xc1 <=> f.c1;
|
pure callback xc1 <=> f.c1;
|
||||||
// ^error{Purity of callbacks 'xc1' and 'f.c1' doesn't match}
|
// ^error{Purity of callbacks 'xc1' and 'f.c1' doesn't match}
|
||||||
callback xc2 <=> f.c2;
|
callback xc2 <=> f.c2;
|
||||||
|
|
@ -149,4 +149,4 @@ Bar_Legacy := Rectangle {
|
||||||
// ^warning{Call of impure callback 'c1'}
|
// ^warning{Call of impure callback 'c1'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import { Rec12 } from "../../typeloader/recursive_import1.slint";
|
import { Rec12 } from "../../typeloader/recursive_import1.slint";
|
||||||
// ^error{No exported type called 'Rec12' found in ".*recursive_import1.slint"}
|
// ^error{No exported type called 'Rec12' found in ".*recursive_import1.slint"}
|
||||||
Blah := Rec12 {
|
export Blah := Rec12 {
|
||||||
// ^error{Unknown type Rec12}
|
// ^error{Unknown type Rec12}
|
||||||
width: 100px;
|
width: 100px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { LineEdit } from "sixtyfps_widgets.60";
|
||||||
// ^warning{"sixtyfps_widgets\.60" was renamed "std-widgets\.slint". Use of the old file name is deprecated}
|
// ^warning{"sixtyfps_widgets\.60" was renamed "std-widgets\.slint". Use of the old file name is deprecated}
|
||||||
|
|
||||||
|
|
||||||
Blah := Window {
|
export Blah := Window {
|
||||||
LineEdit {} // Not an error
|
LineEdit {} // Not an error
|
||||||
Button {} // Not imported
|
Button {} // Not imported
|
||||||
// ^error{Unknown type Button}
|
// ^error{Unknown type Button}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import { X } from "../../typeloader/incpath/should_fail2.slint";
|
import { X } from "../../typeloader/incpath/should_fail2.slint";
|
||||||
|
|
||||||
Foo := Rectangle {
|
export Foo := Rectangle {
|
||||||
x:= X {
|
x:= X {
|
||||||
hello: 42;
|
hello: 42;
|
||||||
meh: 12;
|
meh: 12;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,6 @@
|
||||||
|
|
||||||
import { Y } from "../../typeloader/incpath/should_fail3.slint";
|
import { Y } from "../../typeloader/incpath/should_fail3.slint";
|
||||||
|
|
||||||
Foo := Rectangle {
|
export Foo := Rectangle {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import { Z } from "../../typeloader/incpath/should_fail4.slint";
|
import { Z } from "../../typeloader/incpath/should_fail4.slint";
|
||||||
|
|
||||||
Foo := Rectangle {
|
export Foo := Rectangle {
|
||||||
Z {
|
Z {
|
||||||
property <int> b: b1;
|
property <int> b: b1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,6 @@ import { SomeRect } from "../../typeloader/incpath/local_helper_type.slint";
|
||||||
import "../../typeloader/incpath/local_helper_type.slint";
|
import "../../typeloader/incpath/local_helper_type.slint";
|
||||||
// ^error{Import names are missing. Please specify which types you would like to import}
|
// ^error{Import names are missing. Please specify which types you would like to import}
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,6 @@ import "myimage.png";
|
||||||
import ".";
|
import ".";
|
||||||
// ^error{Unsupported foreign import ".*"}
|
// ^error{Unsupported foreign import ".*"}
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,6 @@ import { NotExported } from "../../typeloader/incpath/local_helper_type.slint";
|
||||||
import { } from "../../typeloader/incpath/local_helper_type.slint";
|
import { } from "../../typeloader/incpath/local_helper_type.slint";
|
||||||
// ^error{Import names are missing. Please specify which types you would like to import}
|
// ^error{Import names are missing. Please specify which types you would like to import}
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,6 @@ export { Image as Plop }
|
||||||
export { string as Boob }
|
export { string as Boob }
|
||||||
// ^error{Cannot export 'string' because it is not a component}
|
// ^error{Cannot export 'string' because it is not a component}
|
||||||
|
|
||||||
Hello := Plop {
|
export Hello := Plop {
|
||||||
// ^error{Unknown type Plop}
|
// ^error{Unknown type Plop}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { SomeRect } from "../../typeloader/incpath/local_helper_type.slint";
|
||||||
|
|
||||||
import { X } from "../../typeloader/incpath/should_fail.slint";
|
import { X } from "../../typeloader/incpath/should_fail.slint";
|
||||||
|
|
||||||
Blah := X {
|
export Blah := X {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
// ^error{Unknown property width in X}
|
// ^error{Unknown property width in X}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
Test := Rectangle {
|
export Test := Rectangle {
|
||||||
property <bool> condition;
|
property <bool> condition;
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
Test := Rectangle {
|
export Test := Rectangle {
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
Hello := Rectangle {
|
export Hello := Rectangle {
|
||||||
|
|
||||||
property <int> aa: 45;
|
property <int> aa: 45;
|
||||||
property <{o:[int], c:string}> bb;
|
property <{o:[int], c:string}> bb;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
Xxx := Rectangle {
|
export Xxx := Rectangle {
|
||||||
|
|
||||||
foo := Rectangle {
|
foo := Rectangle {
|
||||||
callback hello(int) -> int;
|
callback hello(int) -> int;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
Xxx := Rectangle {
|
export Xxx := Rectangle {
|
||||||
|
|
||||||
foo := Rectangle {
|
foo := Rectangle {
|
||||||
callback hello(int) -> int;
|
callback hello(int) -> int;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ Sub := Rectangle {
|
||||||
callback compute_alias <=> compute;
|
callback compute_alias <=> compute;
|
||||||
}
|
}
|
||||||
|
|
||||||
Xxx := Rectangle {
|
export Xxx := Rectangle {
|
||||||
|
|
||||||
foo := Rectangle {
|
foo := Rectangle {
|
||||||
callback hello(int) -> int;
|
callback hello(int) -> int;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
Xxx := Rectangle {
|
export Xxx := Rectangle {
|
||||||
callback plop() -> string;
|
callback plop() -> string;
|
||||||
plop => {}
|
plop => {}
|
||||||
// ^error{Cannot convert void to string}
|
// ^error{Cannot convert void to string}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
background: blue;
|
background: blue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ global Glob := {
|
||||||
property <relative-font-size> rem_allowed: 42rem;
|
property <relative-font-size> rem_allowed: 42rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
X := Rectangle {
|
export X := Rectangle {
|
||||||
|
|
||||||
t := Text {
|
t := Text {
|
||||||
x: "hello";
|
x: "hello";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
Xxx := Rectangle {
|
export Xxx := Rectangle {
|
||||||
|
|
||||||
my-rect := Rectangle {
|
my-rect := Rectangle {
|
||||||
border-width: 44px;
|
border-width: 44px;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
Xxx := Rectangle {
|
export Xxx := Rectangle {
|
||||||
color: white;
|
color: white;
|
||||||
// ^warning{The property 'color' has been deprecated. Please use 'background' instead}
|
// ^warning{The property 'color' has been deprecated. Please use 'background' instead}
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue