Commit graph

104 commits

Author SHA1 Message Date
Olivier Goffart
67dd409f87 Move a few more passes before inlining 2021-10-28 15:52:29 +02:00
Olivier Goffart
5f07678478 Make the layout pass work on non-inlined tree 2021-10-28 15:52:29 +02:00
Simon Hausmann
2ecf6c61d4 Minor cleanup: include the path in the error message when embedding an image fails 2021-10-06 09:44:06 +02:00
Olivier Goffart
521bf192f8 Improve error message for parse error
print the literal token symbol instead of the internal token name
2021-10-06 08:54:14 +02:00
Simon Hausmann
517b731e7b Fix CI build
Turn message about inability to embed images into a warning for now

We do test our tutorial and in the CI build we enforce embedding,
so the icon paths there don't work.
2021-10-05 23:16:46 +02:00
Simon Hausmann
88ad176008 Improve diagnostics when images cannot be located for embedding
This is a two-stage change, that first centralizes the file I/O code
path for on-disk and builtin:/ files. Secondly the resource embedding
pass now produces diagnostics if a file cannot be located.
2021-10-05 23:16:46 +02:00
Olivier Goffart
ae3e1b4680 Allow normal Element to be in the Dialog's button row with dialog-button-role 2021-10-05 09:46:20 +02:00
Simon Hausmann
d3dfd43bdc Tweak dialog error messages
Replace "should" with "must"/"can only" to emphasize that this is an error.
2021-09-30 11:27:50 +02:00
Olivier Goffart
7db9f3dfa9 Dialog: automatically add clicked callback for the standard button
And make the viewer listen to them and set them to automatically close dialogs
2021-09-30 10:21:13 +02:00
Olivier Goffart
7f05bfa309 Add the Dialog element 2021-09-29 16:25:44 +02:00
Simon Hausmann
5ee005c972 Fix panic in LSP when declaring animation on layout controlled property
When an animate foo {} declaration ends up creating an synthetic, invalid BindingExpression,
we still need to give it a span, to ensure that the diagnostics
produced later have *some* location set.

Fixes #515
2021-09-22 16:01:29 +02:00
Simon Hausmann
4d3f08d954 Allow global singletons to have default callback handlers
It's already working, we just need to remove the error handling :-)

Fixes #467
2021-09-06 13:56:27 +02:00
Simon Hausmann
c3ca796b1d Fix missing compiler warning about duplicated ids when using id more than twice
Don't remove the id of a duplicate from the seen set, as it may appear
again.
2021-08-30 20:35:31 +02:00
Tobias Hunger
aea4ecca99 Apply pre-commit hooks to all files 2021-08-17 22:38:16 +02:00
Olivier Goffart
d5b1a95f74 Turn the "duplicated id" error into a warning
Just for compatibility reason with 0.1.0, this is going to be turned
back into an error at a later point
2021-08-12 13:47:11 +02:00
Olivier Goffart
c25538c982 Normalize identifiers to - instead of _
As a result
 - The error messages will now show the error with `-` instead of `_`
 - The LSP will auto-complete with -
 - The interpreter's list of properties will list the property with '-'
   (but we made the change so that set_property, get_property, and so on
   work also if passed a '-')
2021-08-10 22:21:01 +02:00
Olivier Goffart
b6137ecbc4 Error when trying to use internal builtin items 2021-08-09 17:43:22 +02:00
Olivier Goffart
fa770ec262 Fix panic when one of the two branch of a condition is Type::Void
Throw a proper compilation error.
Note that there may be a bit too many error now when the two
branch of a condition are not the same, but it's better than a panic
2021-08-06 19:44:05 +02:00
Olivier Goffart
6a32a8b37a Don't error on empty documents 2021-07-29 17:40:20 +02:00
Olivier Goffart
bd52f4d444 Allow the clip property to be a dynamic property 2021-07-29 15:02:25 +02:00
Olivier Goffart
09c36ae965 Test for commit e0fad7fbdf 2021-07-29 13:25:47 +02:00
Olivier Goffart
be37a9f69a Allow angle and duration in the public API snce we document it 2021-07-26 17:36:02 +02:00
Olivier Goffart
ae210e79ec Properly handle self assignment on non-float types 2021-07-23 16:33:50 +02:00
Simon Hausmann
4f13238ff5 Fix preview on rectangles with opacity or drop shadow
Instead of producing an error, produce just a warning that the effect won't
be visible on root elements.
2021-07-23 11:41:28 +02:00
Olivier Goffart
f5de7e00a0 Make sure error messages don't end with '.'
As suggested in https://github.com/sixtyfpsui/sixtyfps/pull/275#issuecomment-881240725
2021-07-16 12:39:50 +02:00
Olivier Goffart
920903ad19 Throw an error if there are duplicated id in a component 2021-07-07 12:31:40 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +02:00
Tobias Hunger
13d7f5e7bd Janitor: Fix typos in comments and user-facing strings
Also adapt tests for error messages containing the fixed strings.

No behavior change is intended!
2021-06-28 08:32:25 +02:00
Olivier Goffart
9b4bcab926 Better error message when overriding a layout property
As suggested by Simon
2021-06-23 17:15:49 +02:00
Olivier Goffart
e721a4cf1e Report error when the 'x' or 'y' property is set for elements in layout 2021-06-23 16:53:45 +02:00
Olivier Goffart
9d2bd11098 Error when having an animation in a transition on a property which is not part of the state
Fixes #255
2021-06-23 13:05:25 +02:00
Olivier Goffart
7a1ba1a1d5 Forgot to add the test for previous commit 2021-06-22 13:28:15 +02:00
Olivier Goffart
42c25248a8 Allow to give a name to for and if 2021-06-18 16:40:40 +02:00
Simon Hausmann
cc9d5e09f0 Add support for clip on Path elements
This allows clipping the viewbox conveniently.
2021-05-21 19:51:00 +02:00
Olivier Goffart
8f94099a7e Fix reporting of uncalled "max" in imports 2021-05-20 18:11:58 +02:00
Olivier Goffart
e163794549 Fix panic when a non-element type is used as an element 2021-05-07 15:36:10 +02:00
Olivier Goffart
3b73c96c37 Adjust the syntax_tests to the change of length 2021-04-21 17:15:19 +02:00
Olivier Goffart
91ed04a72c Make length (still the default for all property) be the logical length
And a new `physical_length` is now the physical_length unit

Note: this does not change the runtime part yet
2021-04-21 17:15:19 +02:00
Olivier Goffart
87f4a363cf Add support for opacity property 2021-04-15 15:05:09 +02:00
Olivier Goffart
fed73bbd67 syntax_tests: Try to build the object_tree::document even in case of parse error
To make sure it doesn't panic.

Also fix a bunch of errors that were causing panic bacause missing elements in the tree

The goal it to be able to generate a best effort node required for the LSP
2021-04-14 11:46:49 +02:00
Olivier Goffart
533da0ea4c Add missing file 2021-04-12 19:02:37 +02:00
Simon Hausmann
c8f1389529 Restore test that was accidentally removed
It was accidentally removed in commit
9b46e547a2e4fa9beaf23dea8b56458ef4c7c856
2021-02-22 11:17:39 +01:00
Simon Hausmann
13116e8a20 Begin working on the home page 2021-02-22 11:17:38 +01:00
Olivier Goffart
92f9402a39 Fix C++ compilation if using condition between 0 and a unit type 2021-02-16 18:40:32 +01:00
Olivier Goffart
0174db3679 Delay the percentage size conversion to after the layouting phase
So we can see inthe layouting phase if the size was in percent
2021-02-11 15:08:24 +01:00
Olivier Goffart
b75e135459 Support complex product of units
Fixes #68
2021-02-04 12:56:14 +01:00
Simon Hausmann
3854d1236a Fix syntax tests 2021-02-03 13:17:57 +01:00
Simon Hausmann
7982325da4 Change Rectangle::background's type to be a brush
This also introduces the brush type in the compiler and generators. At the
moment only conversion from Color is implemented.
2021-02-03 12:49:44 +01:00
Simon Hausmann
c771bcff45 Print a warning when trying to animate deprecated properties 2021-02-02 22:58:54 +01:00
Simon Hausmann
246398fcb3 Issue a warning when accessing deprecated properties through member lookups 2021-02-02 22:42:02 +01:00