Commit graph

22 commits

Author SHA1 Message Date
Olivier Goffart
dfdbc942f6 Split Expression::CallbackReference and Expresison::FunctionReference 2022-12-06 14:56:25 +01:00
Olivier Goffart
fdf5d4c0dd Fix in/out/private property on global
This is technicly a breking change. But this is also a bug and it was only
allowed since 0.3.2, so it is probably fine.

The problem is that any property access to a global was considered as being
local.
Now, change that so that property access to a global object is no longer
local, and other components can't access private property anymore
2022-12-06 10:29:44 +01:00
Simon Hausmann
7122d22c88 janitor: use the new default attribute for enums 2022-12-05 10:20:39 +01:00
Simon Hausmann
d8a1f2cf01 Introduce a rem unit in the type system
This allows specifying font sizes relative to the Window's
default-font-size, similar to CSS rem.
2022-11-24 11:33:38 +01:00
Tobias Hunger
a4e070bdfd compiler: Add support for handling binding expressions for the LSP 2022-11-21 15:01:09 +01:00
Olivier Goffart
6ab6ae63d4 input output property: fix semantic with two ways bindings 2022-11-11 13:02:53 +01:00
Olivier Goffart
425b477874 Always keep the binding of the right in a two way binding
When having a binding such as
```
  foo <=> bar
```
The default value will always be the value of `bar` regardless what's
the value of foo.

This change of behavior is the only one that makes sense bacause if we
are having repeater or if, this will be a problem. eg:
```
property <xxx> bar;
if (some_cndition) : SomeElement {
   foo <=> bar;
}
```
Then we can't possibly take the default value of foo for the value of
bar since it depends on the condition. (and it is even worse in case of
repeater)

This is a change of behevior, this is why the tests have changed. The
cse of tests/cases/bindings/* were already covered by a warning since
0.3.0 so that should be fine. But the warning did not trigger for
builtin property such as `visible`  (eg, input/visible_mouse test)

Also some internal two way bindings had to be reversed.

cc: #1394
2022-11-04 15:32:20 +01:00
Olivier Goffart
2ceafc6392 New syntax: Make it an error to set the value of a builtin output property
With the old syntax, this becomes a warning
2022-11-01 12:51:45 +01:00
Olivier Goffart
28ae8f7bc4 Refactoring: split ElementType away from the types used as property type
These are two different concept, and it is confusing to keep them in the
same enum

We want to support component without any base element, and Void is
already used for global component, so do this refactoring before
2022-10-26 14:50:44 +02:00
Olivier Goffart
9518e7184d Check access rights when accessing properties within expression 2022-10-20 08:02:26 +02:00
Olivier Goffart
6ee932883a Rename stark-style to dark-color-scheme
That's the term used by CSS
2022-10-19 15:23:41 +02:00
Olivier Goffart
0ba468c236 Use a builtin function to access the dark-style
instead of a property on NativeStyleMetrics
2022-10-19 15:23:41 +02:00
Simon Hausmann
27fea8b9f3 Fix rustdoc warnings with nightly
Use backticks as recommended by rustdoc for items that could be interpreted as HTML tags.
2022-10-12 17:29:46 +02:00
Olivier Goffart
92b4f52556 Make mod() a macro that can take generic types instead of just integer 2022-07-11 17:49:28 +02:00
Olivier Goffart
d48c590346 Add animation-tick() builtin function
Low level primitive allowing to build always running animations
2022-07-11 17:49:28 +02:00
Olivier Goffart
b4ebd88d35 Implements @radial-gradient(circle, ...)
Only the circle is implemented so far.

Part of #263
2022-05-19 14:07:20 +02:00
Olivier Goffart
54a6cb22ee Allow .darker and .brighter on Brush 2022-04-12 13:01:53 +02:00
Olivier Goffart
6622f33327
Fix conversion of struct with array of literals (#1109)
Fixes #944
2022-03-28 14:41:11 +02:00
Simon Hausmann
304e06f758 Begin rasterizing glyphs for glyph embedding
Enable with `SLINT_EMBED_GLYPHS=1` and select sizes like
`SLINT_FONT_SIZES=12,16`

This change just puts the data structures in place, rasterizes a fixed
subset, embeds that into the rust generated code and calls a backend
function for registering the font that is unimplemented.
2022-02-15 15:52:24 +01:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Olivier Goffart
03534039d6 Replace more .60 by .slint
Mainly an automated change with
    git grep -O"sed -i 's/\.60/.slint/g'" -w "\.60"

and some manual checks
2022-02-02 10:12:31 +01:00
Tobias Hunger
e6b24bceec [reorg]: Set up and populate the internal directory
Move "internal" crates into the `internal` directory. This first batch
includes most of sixtyfps_runtime but leaves the rendering backends
alone for now.

pre-commit applied some cleanups to the moved files:
 - Consistent newline at end of file policy
 - trimming trailing whitespace
 - Formatting Cargo.toml files.
2022-01-31 16:00:50 +01:00
Renamed from sixtyfps_compiler/expression_tree.rs (Browse further)