Simon Hausmann
3391aa0312
Remove the import resolve callback from the compiler configuration
...
Re-apply commit 2dcbc45cd6
but now do the
resolution from a relative import path to either an absolute path or url
in the compiler itself.
2021-03-16 14:21:33 +01:00
Olivier Goffart
3db3400951
Rename the Object type to Struct in the compiler
2021-03-16 12:38:53 +01:00
Simon Hausmann
e3a33dffe0
Revert "Remove the import resolve callback from the compiler configuration"
...
This reverts commit 2dcbc45cd6
.
It breaks loading of the printer demo in the editor because in
import_file we fail to return the absolute path and thus end up
importing common.60 too many times.
2021-03-16 11:43:33 +01:00
Olivier Goffart
455693dbc0
Documentation for the interpreter crate
2021-03-16 11:24:02 +01:00
Simon Hausmann
2dcbc45cd6
Remove the import resolve callback from the compiler configuration
...
It turns out that this isn't really needed with the current
implementation.
2021-03-15 20:02:46 +01:00
Simon Hausmann
8372d3f6d8
Rename call_*
to invoke_*
for callbacks
...
Fixes #187
2021-03-15 17:01:05 +01:00
Simon Hausmann
b27034efa5
Rename sixtyfps::IntoWeak
into sixtyfps::ComponentHandle
and remove Clone
from generated components
...
`ComponentHandle` offers a richer API of common functions, such as
`show()`/`hide()` as well as the new `clone_strong()` - that should help
to prevent mistakely created strong reference that may cause leaks.
Fixes #188
2021-03-15 16:01:13 +01:00
Olivier Goffart
9676ed398d
Fix wasm build
2021-03-15 15:14:15 +01:00
Olivier Goffart
f1a7847820
Fixup syntax_tests
2021-03-15 12:41:10 +01:00
Olivier Goffart
a203097b88
Attempt to fix windows syntax_tests
...
Looks like the slashes were not canonical on Windows
2021-03-15 12:05:03 +01:00
Olivier Goffart
cae88f0823
Create a Diagnostic quen the main .60 file can't be loaded
2021-03-15 11:44:20 +01:00
Olivier Goffart
b2572f8bb3
Fix parser test macro
2021-03-15 10:50:33 +01:00
Simon Hausmann
70ff7baa85
Fix compilation after diagnostics API changes
2021-03-15 10:43:26 +01:00
Olivier Goffart
014e13b05f
Make Diagnostic field private
2021-03-15 10:37:24 +01:00
Olivier Goffart
730b1ccff2
Refactor diagnostic: Merge BuildDiagnostic and FileDiagnostic
2021-03-12 19:32:50 +01:00
Olivier Goffart
11e0be5130
Add the SourceLocation into the Diagnostic
2021-03-12 12:49:19 +01:00
Olivier Goffart
fc35d101d9
Rename diagnostics::level to DiagnosticLevel
2021-03-11 16:27:40 +01:00
Olivier Goffart
968dfaae87
Put what is the FileDiagnostics into the SourceFile so the SourceFile has the content
2021-03-11 16:23:46 +01:00
Olivier Goffart
7c48bcdd4c
Add the source file getter to the Spanned trait, and remove SpannedWithSourceFile
2021-03-11 14:09:55 +01:00
Olivier Goffart
436d113b1e
Rename ResourceReference
to ImageReference
in the compiler
2021-03-11 10:29:05 +01:00
Olivier Goffart
6f88d78303
Rename Resource
to ImageReference
in the runtime
2021-03-11 10:06:23 +01:00
Olivier Goffart
c840b046ae
Rename the "resource" type to "image"
2021-03-10 17:24:31 +01:00
Simon Hausmann
b591f7de2c
Add Window.default-font-size
...
This allows getting rid of the `DemoText` element in the printer demo
2021-03-02 13:33:43 +01:00
Simon Hausmann
27bdb4d481
Added Window.default-font-family
...
One step towards getting rid of `DemoText` in the printer demo
2021-03-02 13:25:21 +01:00
Simon Hausmann
3d7eb6ac70
Fix brightening function name in .60
...
An earlier revision of the patch called it `lighter` and it was renamed
to `brighter`, as bright is the opposite of dark. But the function name
in .60 wasn't changed yet.
Amends commit 391d0152f0
2021-02-24 13:40:27 +01:00
Simon Hausmann
391d0152f0
Add Color::brighter/darker functions
...
These are exposed in .60 as well as in Rust and C++ and implemented by
converting to HSV color space and adjusting the brightness (value).
2021-02-24 10:49:27 +01: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
5727a4cf02
implement square root
2021-02-20 08:53:08 +01:00
Simon Hausmann
2f3c280ebe
Fix cargo fmt --check
...
Not sure what happened but I guess the new release made it stricter
2021-02-18 13:45:42 +01:00
Simon Hausmann
8b28c4d792
Fix compilation with empty image urls when resource embedding is enabled
...
`@image-url("")` should translate to `Resource::None` instead of
`Resource::AbsolutePath` to avoid that the rust compiler tries to
include a directory when embedding images.
2021-02-17 16:01:54 +01:00
Olivier Goffart
09ea6572e4
Rust: Fix if
in box layouts
2021-02-17 09:22:39 +01:00
Simon Hausmann
7cea088a2c
Add support for letter-spacing in text
...
This is conveniently supported by femtovg and Qt
2021-02-16 22:14:50 +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
2edf247023
Rust: fix compilation when using bindings in global
2021-02-16 15:16:01 +01:00
Olivier Goffart
86a440eb79
Fix infinite loop when parsing states
...
Noticed that because i had a merge conflict in a file and the build hang
2021-02-16 08:56:02 +01:00
Olivier Goffart
ed1fc31b84
Put the window background color in the StyleMetrics
...
And make use of Window::background in Qt
2021-02-15 15:57:58 +01:00
Olivier Goffart
b580736caf
Fix error in the generated rust code with laoyut in for
2021-02-15 15:00:52 +01:00
Olivier Goffart
861e76b0ef
Fix vinding when two native property are linked
...
Fixes #161 again
2021-02-12 21:40:34 +01:00
Simon Hausmann
500919745e
Add an internal Rotate element
...
This is just a starting point, to be turned into a real Transform
element later, along with syntactic sugar to turn rotation, etc. into a
transform matrix in the generated output.
2021-02-12 17:31:06 +01:00
Olivier Goffart
68de483f30
Ensure that the repeater are updated when we compute the layouts
...
Fixes #167
2021-02-12 10:07:33 +01:00
Olivier Goffart
81b63c3b3f
Small reformating fix
2021-02-12 09:56:37 +01:00
Olivier Goffart
9eac131ae5
Add the logo in the docs
2021-02-12 08:24:42 +01:00
Olivier Goffart
096f55e365
Change behavior of percent sice within the layout
...
So that size with percentages don't affect the maximum/minimum size
Fixes #117
2021-02-11 20:32:26 +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
Simon Hausmann
2dd5ea61bb
Add support for Path.fill-rule
...
For some reason it's not working with the Qt renderer though
2021-02-10 14:08:32 +01:00
Simon Hausmann
57d3a34996
Prospective fix for doc errors
...
In the nightly it appears that `no_mangle` is now considered "unsafe",
so we need to allow that in the ffi modules. For the layout code this
patch also creates that ffi module with prefixed function names, like in
the other modules and only allows unsafe in there.
2021-02-10 11:26:28 +01:00
Simon Hausmann
2ce672bd68
Reduce dependencies
...
Use only specific lyon packages instead of pulling all of them in.
This slightly speeds up compilation as well as for example lyon_tesselation
doesn't need to be compiled anymore.
2021-02-09 17:22:01 +01:00
Olivier Goffart
f7a76dc352
Add ImageFit::cover, and fix ImageFit::contain
2021-02-09 10:52:04 +01:00
Olivier Goffart
0f251a7b82
Fix merge of two way binding
...
collext the set of all binding mapping to the same property, and only keep
the binding with the highest priority
Fixes #161
2021-02-08 18:58:23 +01:00