Commit graph

497 commits

Author SHA1 Message Date
Olivier Goffart
e0fad7fbdf Proper .60 compilation error when changing a property linked with a two way binding in a state
Instead of generating wrong code or panic
2021-07-27 10:18:24 +02:00
Olivier Goffart
f544e67fa1 Fix panic or invalid code caused by invalid expression in the tree
When there is an animaiton but no expression, the binding is
left with an invalid expression.
State was keeping that invalid expression as part of sub expression
this is a regression since commit ba32777cab
2021-07-27 09:10:33 +02:00
Olivier Goffart
74bc9521b9 Fix the scope while resolving a model expression
The `self` was always referring to the `root` instead of the enclosing
element.
2021-07-26 11:08:46 +02:00
Olivier Goffart
ac751c1052 Re-arrenge a match
looks prettier this way
2021-07-23 17:11:54 +02:00
Olivier Goffart
ae210e79ec Properly handle self assignment on non-float types 2021-07-23 16:33:50 +02:00
Olivier Goffart
807377ed40 fix warnings 2021-07-23 15:40:11 +02:00
Olivier Goffart
01f11695a7 Properly merge the animation when inlining and removing aliases
Fix #193
Fix #345
2021-07-23 15:25:53 +02:00
Olivier Goffart
ba32777cab Refactoring: move the animation in the PropertyBinding struct
Since they always belong together.

This will help for issue #193
2021-07-23 15:25:53 +02:00
Tobias Hunger
2cdc5848a2 Janitor: Replace float comparison dance with approx_eq from euclid
Sixtyfps uses euclid already, so let's use euclid for float comparisons
as well.

I changed the code to decide whether a number is a positive integer to
make do without a comparison along the way.
2021-07-23 13:48:52 +02:00
Tobias Hunger
9539a53480 Janitor: Fix clippy::redundant_clone 2021-07-23 13:48:52 +02:00
Tobias Hunger
d64291245e Janitor: Fix clippy::len_zero 2021-07-23 13:48:52 +02:00
Tobias Hunger
3e0534afea Janitor: Fix clippy::needless_lifetimes 2021-07-23 13:48:52 +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
2447de3d1b We should only set the height of the element in a repeater for the children of ListView 2021-07-22 18:18:58 +02:00
Olivier Goffart
ff8f7930d2 ListView: fix default height of items 2021-07-22 17:13:36 +02:00
Olivier Goffart
8743ff87ed Consider that elements in a listview are part of a layout 2021-07-22 14:38:58 +02:00
Olivier Goffart
c2433d0f0b Fix panic when parsing linear-gradient with a trailing coma 2021-07-22 14:38:58 +02:00
Simon Hausmann
d6eb45b4f8 Regression: Fix missing window background
After commit 492af0f67c the native class
name of "Window" changed to "WindowItem", so the string based check here
didn't match anymore. For consistency this match now uses the element
name instead, like in other places in the compiler.
2021-07-22 13:02:04 +02:00
Tobias Hunger
aeebbb1d96 Janitor: Fix remaining clippy::option_map_unit_fn 2021-07-21 19:44:57 +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
e633ee825d Fix error with struct that are only referenced by callbacks
We would have a compilation error in rust or C++ because the
collect_struct visitor would not visit these type and not produce
them correctly
2021-07-15 14:06:49 +02:00
Olivier Goffart
cc8249212d Fix name conflict when having two global with the same name in different files
Give globals an unique id so two global with the same name imported
from different file don't clash

Fixes #159
2021-07-13 14:36:38 +02:00
Tobias Hunger
bf48a6c65e Janitor: Remove some unnecessary returns 2021-07-08 20:43:38 +02:00
Tobias Hunger
63bc31aa44 Janitor: Remove unnecessary closure 2021-07-08 20:43:38 +02:00
Tobias Hunger
35dd3ed282 Janitor: Remove redundant clone() calls 2021-07-08 20:43:38 +02:00
Olivier Goffart
8e52b7d865 Fix bug that caused two way binding to sometimes disapear 2021-07-08 17:44:50 +02:00
Olivier Goffart
4604b70463 We need to collect the ressources in the root component 2021-07-07 19:45:50 +02:00
Olivier Goffart
a987b225b5 Collect all used components before inlining
And do some passes before inlining

We will need the list of components before inlining in order to generate
them if we disable inlining

So we can do some passes on each component before they are inlining

I tried to put the flickable pass in that list, but it did not work
if the Flickable itself is the root of a component
2021-07-07 17:58:43 +02:00
Olivier Goffart
920903ad19 Throw an error if there are duplicated id in a component 2021-07-07 12:31:40 +02:00
Tobias Hunger
e5bdeaa804 Janitor: Remove unnecessary & 2021-07-07 08:42:28 +02:00
Tobias Hunger
ac2d17e8e4 Janitor: Remove unnecessary format! 2021-07-06 22:34:21 +02:00
Tobias Hunger
c1c9e591f7 Janitor: Simplify if X.is_none() { return None } to X?; 2021-07-06 22:34:21 +02:00
Tobias Hunger
56885bd71d Janitor: Remove useless type conversion 2021-07-06 22:34:21 +02:00
Tobias Hunger
af0f193f1d Janitor: Fix clippy::if_same_then_else error
In this case this feels at controversial, but in general I find this
clippy lint pretty helpful: It has caught several copy-paste errors
before.

No behavior change is intended with this patch.
2021-07-06 21:28:36 +02:00
Olivier Goffart
67f0dc280f ptimized unused propery away
Currently, it is a bit limited in the amount of property that it removes
because it will not remove property that are used by properties being
removed, or will consider setting properties as an usage
2021-07-05 15:39:49 +02:00
Tobias Hunger
4be9ca7ffd Janitor: Remove useless () return types 2021-07-05 09:48:29 +02:00
Simon Hausmann
3e55b0e8f8
Prospective cspell warning fix 2021-07-03 10:10:10 +02:00
Tobias Hunger
040c7735ec Dropping a reference does nothing
Is this what was actually intended here?
2021-07-03 09:43:07 +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
Tobias Hunger
24872e2604 Janitor: Fix typo in in local function name
No behavior change is intended.
2021-06-28 08:32:00 +02:00
Tobias Hunger
96a4885eaf Janitor: Fix type on function name
No behavior change is intended!
2021-06-28 08:32:00 +02:00
Tobias Hunger
4b077d48ae Janiotor: String fix that might have side effect
This changes the name of a NamedReference and I am not sure this change
has no side effects, so put this into an extra patch.

As usual: No behavior change is intended!
2021-06-28 08:32:00 +02:00
Tobias Hunger
a39ce28c7a Janitor: Fiy typo in function name
No behavior change is intended here!
2021-06-28 08:32:00 +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
40a6e1ecb8 Fix warning 2021-06-23 13:10:24 +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
725543108f Fix tests regarding to constant propagation 2021-06-22 14:59:07 +02:00
Olivier Goffart
cb75d44acc Fix setting model properties to aliased properties 2021-06-22 13:31:27 +02:00