Olivier Goffart
1f64f7ab27
Also set the preferred size for the GridLayout
...
Issue #182
2021-04-21 18:56:28 +02:00
Olivier Goffart
8ac0fe78ad
Test for the interpreter
2021-04-21 17:15:19 +02:00
Olivier Goffart
14772a9b58
Handle reduction of logical lenght when the units are more complex
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
Simon Hausmann
dbfa5cadde
Fix text rendering with path-clipping
...
When rendering into a layer, we applied the y coordinate system flip
using a transform. That transform is incompatible with
Canvas::fill/stroke_text, which uses transform_point to transform the
glyph quads. That appears to not work, as opposed to the
y-flip in the main vertex shader.
Fortunately we can work around it by doing the flip when rendering the
layer image (as part of the fill).
Closes #199
2021-04-20 22:25:59 +02:00
Simon Hausmann
f50d573120
GL backend: Add support for path clipping, used for rounded rects
...
Render the sub-tree of items into an intermediate image and fill the
clip path with that image.
Fixes #199
2021-04-20 10:26:11 +02:00
Olivier Goffart
862f65c151
Fix panic in the interpreter when accessing uninitialized global
...
As the type of the Value wouldn't match the expected type
Fixes #173
(Also added a way to test the interpreter by making the interpreter
make sure the property "test", if it exists, is true)
2021-04-19 11:41:36 +02:00
Olivier Goffart
87f4a363cf
Add support for opacity property
2021-04-15 15:05:09 +02:00
Olivier Goffart
aeff269bd4
Fix another panic caused by some NamedReference of the layout not being visited
2021-04-14 17:23:33 +02:00
Olivier Goffart
b7f3f39143
Test for previous fix
2021-04-14 16:15:14 +02:00
Olivier Goffart
27ac4f4fc7
Move a testcase in its own folder
2021-04-14 15:48:42 +02:00
Simon Hausmann
48e6d2f48b
Fix handling of non-zero border width in clip-enabled Rectangles
...
The border should be visible (as in the included test case), which this
patch fixes for Qt by subtracting the border width just like when drawing.
2021-04-14 13:34:51 +02:00
Olivier Goffart
380b421507
Fix warning in test
2021-04-12 15:42:58 +02:00
Olivier Goffart
e67deebc76
Make rgb() and rgba() a macro that can take 3 or 4 arguments
...
and that accept both percent or integer
Closes #139
2021-04-12 15:19:15 +02:00
Olivier Goffart
ca64a540c4
Continue support for rgb() function
...
Fixup of previous commit which was part of https://github.com/sixtyfpsui/sixtyfps/pull/139
2021-04-12 15:18:25 +02:00
Olivier Goffart
366ce83dae
Fix crash with repeater in a Flickable
2021-04-12 10:35:30 +02:00
Olivier Goffart
563866a60f
Remove debug assertion that is not always true
...
because Int32 and Float32 can be compared but aren't the same type
2021-04-09 19:28:32 +02:00
Olivier Goffart
b45190ca2d
Flickable geometry
...
Issue #192
2021-04-09 19:14:48 +02:00
Simon Hausmann
9a06a29314
Implement dynamic image-fit and aspect ratio behavior for Image elements
...
This is part of #168 where `image-fit` has dynamic defaults and missing
width or height property bindings are installed with an aspect ratio
preserving behavior.
2021-04-09 15:17:52 +02:00
Simon Hausmann
81dcd02dd5
Improve preferred size test
...
Test not only the regression that 843f52b3c5 introduced but also test that
the application of the preferred size on the layout axis works.
2021-04-08 20:04:50 +02:00
Simon Hausmann
794d3ec6ec
Revert "Add a nodejs testing function for apply_layout"
...
This reverts commit beb5d63d1b .
Oops, the more modern style *is* to use send_mouse_click.
2021-04-08 16:58:37 +02:00
Simon Hausmann
beb5d63d1b
Add a nodejs testing function for apply_layout
...
This will allow making the JS test code more similar to the C++/Rust code,
allowing replacing synthetic mouse clicks.
2021-04-08 16:51:51 +02:00
Simon Hausmann
8fb0c060d6
Add JS test for cross axis box preferred size test
...
Amends commit 1cfbbb090a
2021-04-08 16:36:29 +02:00
Simon Hausmann
c448003e2f
Add test case for preferred size in boxes bug
...
Amends commit 7c1738eeea
This also adds the preferred-width/height fake properties to allow overriding.
2021-04-08 16:13:53 +02:00
Olivier Goffart
3cad21c23f
Test for my previous commit
2021-04-08 15:45:30 +02:00
Olivier Goffart
96ee9ea7a0
GridLayout: Element outside of a Row should go in a new row
2021-04-08 11:46:24 +02:00
Simon Hausmann
05a8bbad8f
Work around css-color-parser2 bug
2021-04-01 10:03:39 +02:00
Simon Hausmann
477729da52
Improve brush property test coverage
...
Test that assigning colors works:
* Test the implicit `Brush(const Color &)` C++ constructor
* Add derive_more::From to allow convenient conversion in Rust
* When assigning to brush properties in JavaScript, try at least to see if it's a color string (could be extended in the future)
2021-04-01 08:27:10 +02:00
Simon Hausmann
cf22548586
Add a test case for instantiating brush properties
...
Amends commit e6d165dfbb
2021-04-01 08:16:32 +02:00
Olivier Goffart
f4ed0e333b
Remove useless message in an assert
...
The goal was probably to do an assert_eq, because passing 1 as a message don't make sense
2021-03-25 18:54:00 +01:00
Simon Hausmann
8372d3f6d8
Rename call_* to invoke_* for callbacks
...
Fixes #187
2021-03-15 17:01:05 +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
Olivier Goffart
5727a4cf02
implement square root
2021-02-20 08:53:08 +01:00
Olivier Goffart
b34a34cea0
C++ Make sure that the layout is properly updated when the model of a for or if changes
...
The problem is that the backend is using the `meta_property_listener` to know
if the layout must be updated, but the C++ code would not register a dependency
NOTE about the test: The test doesn't really test that it works because
the test backend don't have a meta_property_listener and apply the layout
inconditionally in sixtyfps_send_mouse_click
2021-02-18 09:40:12 +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
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
26c04c3550
Add test for previous commit
2021-02-16 15:22:06 +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
1f318f2d10
Use the new mouse event API for the flickable
...
Issue #166
2021-02-13 16:58:04 +01:00
Olivier Goffart
7088d30038
Don't use rust assert in C++
2021-02-12 21:59:33 +01:00
Olivier Goffart
edd1a321dc
Add JS test for previous patch
2021-02-12 21:47:10 +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
1af6d1e187
Fix test from previous patch
2021-02-12 10:36:23 +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