Simon Hausmann
016d776b7d
Simplify implementation of absolute-position
...
Since we materialize only one point property, we don't need to cache the
parent position in a separate property, but we can just store that in
the binding.
2023-06-21 10:02:04 +02:00
Simon Hausmann
ab0e38c76d
Merge absolute-x
and absolute-y
"virtual" properties into absolute-position
( #2942 )
...
The type of thep property is `Point`, which existed before. It was
mapped to `slint::private_unstable_api::re_exports::Point` (euclid) and
is now mapped to slint::LogicalPosition (also in C++).
2023-06-21 08:17:57 +02:00
Olivier Goffart
fdec5960bd
Support for @rust-attr on enums
2023-06-19 22:40:49 +02:00
Olivier Goffart
300cb06ac8
Make sure we don't load internal files
2023-06-16 22:03:45 +02:00
Olivier Goffart
11dea135f7
Domain: slint-ui.com -> slint.dev
2023-06-16 10:55:08 +02:00
Tobias Hunger
04d1229685
Fix licnese information using xtask
2023-06-16 09:14:20 +02:00
Aurindam Jana
039e54a5de
Add royalty free license to files except examples and docs ( #2888 )
2023-06-15 11:20:50 +02:00
Olivier Goffart
af604a29b4
Ensure there are no duplicated enum values
2023-06-12 13:02:14 +02:00
Olivier Goffart
e97a2e8229
Translations: support context
2023-06-06 14:48:48 +02:00
Simon Hausmann
1bf05eae7c
Add support for absolute-x and absolute-y properties on any element ( #2823 )
...
Fixes #1691
2023-06-06 14:37:53 +02:00
Olivier Goffart
9b3ccd3dc3
Check validity of the format string at compile time
2023-06-05 16:34:59 +02:00
Olivier Goffart
dcd8450dfa
WIP: start working on translations: @tr()
...
This commit just do the parsing of the @tr macro.
2023-06-05 16:34:59 +02:00
Simon Hausmann
0f54b9599b
Add support for manually closing PopupWindows
...
This patch adds a `close()` function that can be called to close a popup
window, and a `close-to-click` boolean that can be set to false to
disable the default behavior.
2023-06-02 18:07:49 +02:00
Olivier Goffart
6441968a43
Janitor: Remove trailing spaces in most files
2023-05-04 08:14:28 +02:00
Olivier Goffart
6111b17a7c
Proper error when wrong type used in an unary operation
...
Fixes #2669
2023-05-02 17:41:36 +02:00
Olivier Goffart
d881a4fb66
Syntax tests: move some tests to another folder
...
tidy a bit the basic directory
2023-05-02 13:06:50 +02:00
Tobias Hunger
bbdd6aeab7
compiler: Ignore leading whitespace when parsing
...
... and update all out test cases accordingly.
2023-04-26 17:22:13 +02:00
Olivier Goffart
ae1fb4c7cf
Handle complex forward-focus loops
2023-04-24 18:03:33 +02:00
Olivier Goffart
7e7b9176a7
Don't infinite loop when forwarding focus to self
2023-04-24 18:03:33 +02:00
Olivier Goffart
a1ea00553f
Compiler: hint when an id has the same name as a property or enum value
2023-04-18 16:16:31 +02:00
Olivier Goffart
875a7ea179
Parser: Nicer error when extra top-level semicolon
...
Recover from extra semicolon
2023-04-17 15:13:20 +02:00
Olivier Goffart
ee9f730a6d
Parser: Don't parse everything as a component
...
The old parser always try first to find `Foo :=` from the old syntax so it
would error saying it expect an identifier or `:=`
But if we don't find a component, don't try to parse it as a component too early
This way we get better error and better auto-completions
2023-04-17 07:58:18 +02:00
Olivier Goffart
40922874fa
parser: don't parse error on empty import statement
...
Report the error later when loading the import.
That way, we get a more complete AST for auto-completion
2023-04-17 07:58:18 +02:00
Olivier Goffart
82ae83ce8c
Parser: don't have the whitespace as part of an expression
...
That way the error for an expression is at a better location, and
this also prevent the formater that removes space in expressions to
remove the spaces before the expression that shouldn't be removed
2023-04-14 17:46:19 +02:00
Simon Hausmann
d87af7e917
Fix panic when binding Path's commands property to a model entry's field
...
Fixes #2466
2023-04-03 15:25:13 +02:00
Olivier Goffart
3267d68541
Turn warning about non-existing image into error
...
This is only an error if we embedd recources.
(When using absolute path it is not an error/warning)
2023-03-27 11:14:25 +02:00
Olivier Goffart
1089d29ebb
Make Empty not fill the parent by default
...
Unless `preferred-*:100%` is set
Part of #2284
2023-03-24 11:15:05 +01:00
Olivier Goffart
47ac396bc0
compiler: turn a warning into an error
...
cc #2024
2023-03-20 19:13:10 +01:00
Olivier Goffart
41157b9984
Fix visible property on the root of a component
...
Just like opacity and other properties, it needs to prevent inlining.
And also add the same warning as for opacity if it is used on the root
(the Window)
2023-02-14 13:28:54 +01:00
Olivier Goffart
4f00f268a5
Make the old syntax a warning
2023-02-14 12:38:39 +01:00
Simon Hausmann
e09943ead5
Improve error message when trying to create a two-way binding to model data
...
Closes #2186
2023-02-10 13:13:15 +01:00
Olivier Goffart
9c20369653
Fluent style: cleanup unwanted properties
...
Don't make our widgets inherit element that we didn't want to expose in the API
The other styles will be synchronized with later
2023-02-03 20:29:26 +01:00
Olivier Goffart
7290049a17
Fix panic parsing invalid linear grandient
...
If the last position expression is invalid due to an unrelated error,
the code that tries to do the interpolation was panicking with the
message "The last should never be invalid". (Because it assumed that
invalid meant that it was not set, and we added a 100% for that last
one if it wasn't set. But if it is set and invalid, this would error.)
2023-01-27 13:56:48 +01:00
Simon Hausmann
9180704d70
Warn about components that are neither used nor exported
2023-01-26 15:52:40 +01:00
Simon Hausmann
448b216bd8
Second stage of cleaning up the export handling of the slint root component
...
Commit 24dcef5fed
added a warning for the
implicit export of last component. For 1.0, this commit makes it so that
the root component is determined by the last export in the file.
2023-01-26 15:52:40 +01:00
Olivier Goffart
5bb84c1d69
Remove deprecated Keys
enum in slint language
2023-01-26 15:35:18 +01:00
Olivier Goffart
a0fb8bc771
Remove support of old SIXTYFPS_ env variable, and sixtyfps_widgets.60
2023-01-26 13:36:38 +01:00
Olivier Goffart
ee672d65f5
Fix panic when the binding loop is caused by accessing the same component twice
...
The component properties might be accessed through different paths so we
may still reach a case where we have to borrow something that is already
borrowed
2023-01-24 18:01:30 +01:00
Simon Hausmann
24dcef5fed
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.
2023-01-23 15:19:49 +01:00
Simon Hausmann
629c7ed80e
Remove undocumented and dysfunctional PathLayout
...
This type is poorly implemented and not documented. Let's remove it for now.
It shall remain available in the git history in the event of a resurrection.
2023-01-21 13:10:19 +01:00
Olivier Goffart
8d7b8df922
Fix conversions of array literal containing struct with array literal
...
Fixes #2023
2023-01-02 23:53:22 +01:00
Olivier Goffart
dace899cc5
Pure function: make it a warning in legacy context instead of an error
2022-12-22 00:26:27 -08:00
Olivier Goffart
8fc7c2dafc
Error when mixing purity in callback aliases
...
Also adjust the way we report error while infering to avoid double
reporting errors
2022-12-22 00:26:27 -08:00
Olivier Goffart
1cbd61145e
WIP: pure qualifier for callback and functions
2022-12-22 00:26:27 -08:00
Simon Hausmann
554d153e35
Limit re-exporting of types
...
- Only allow one module re-export per file
- Warn when a re-exported type clashes with a locally exported type, and prioritize the local type.
2022-12-09 11:05:08 +01:00
Simon Hausmann
03fe599890
Add support for re-exporting modules
...
Use `export * from "somewhere.slint"` to avoid having to repeat all the
types of an existing module in order to re-export all of the types.
2022-12-09 11:05:08 +01:00
Olivier Goffart
3c5aeb5897
Test for binding loops involving functions
2022-12-06 14:56:25 +01:00
Olivier Goffart
ed07cd825d
Make functions private by default unless annotated with 'public'
2022-12-06 14:56:25 +01:00
Olivier Goffart
dfdbc942f6
Split Expression::CallbackReference and Expresison::FunctionReference
2022-12-06 14:56:25 +01:00
Olivier Goffart
4672e54f5e
Compiler: make calling functions work
2022-12-06 14:56:25 +01:00