Commit graph

661 commits

Author SHA1 Message Date
Olivier Goffart
55726cc10d fix two way binding when they are declared twice
Fix the galery's disable button not disabling most widgets
2021-02-05 18:33:28 +01:00
Olivier Goffart
49c7300907 Support for if else in statements 2021-02-05 13:53:37 +01:00
Olivier Goffart
a0fe10906c Fix rust compilation of return value from callback
... if the rust type is not exactly right
2021-02-05 13:53:37 +01:00
Olivier Goffart
0e2471f76b Image::colorize support
(Qt only)
2021-02-04 17:44:01 +01:00
Olivier Goffart
b75e135459 Support complex product of units
Fixes #68
2021-02-04 12:56:14 +01:00
Simon Hausmann
66df71a3ca Convert Path to support brushes
* Rename `fill-color` to `fill`
* Rename `stroke-colo` to `stroke`
* Support using a brush for both properties
2021-02-03 15:45:33 +01:00
Simon Hausmann
89c3423ec3 Fix some deprecation warnings in the tests 2021-02-03 15:09:41 +01:00
Simon Hausmann
1d54947de9 Fix compilation of @linear-gradient with brush properties in C++ 2021-02-03 13:22:44 +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
Olivier Goffart
4fd3eaf9d1 Add a SIXTYFPS_TEST_FILTER macro to be able to limit the tests we compile in
Quite usefull to quicly compile some tests for the rust backend which is slow to compile
2021-02-03 10:41:19 +01:00
Olivier Goffart
a143656dc9 Test driver: move some common code in the lib 2021-02-03 10:32:25 +01:00
Simon Hausmann
308f51add7 Print warnings generated by doc tests 2021-02-02 22:42:02 +01:00
Simon Hausmann
e61529976e Issue warnings when creating bindings against deprecated properties 2021-02-02 22:42:02 +01:00
Olivier Goffart
294cf9bbe3 Convert from literal 0 to any unit-like types
cc #68
2021-02-02 15:38:07 +01:00
Olivier Goffart
cd00da0f24 Fix doctests on windows 2021-02-02 15:34:05 +01:00
Olivier Goffart
f2ab456a7b Test the .60 snippet in the documentation 2021-02-02 14:56:22 +01:00
Olivier Goffart
7613b9231f Rename the rust test driver in a consistant way 2021-02-01 18:45:14 +01:00
Olivier Goffart
50ce2d08fd Split the nodejs and the interpreter test driver 2021-02-01 18:43:48 +01:00
Olivier Goffart
c25f383308 WIP: split interpreter and nodejs 2021-02-01 18:37:24 +01:00
Olivier Goffart
6b20d05efb Move the C++ driver to its own crate 2021-02-01 18:34:49 +01:00
Olivier Goffart
09ce4142a5 Some reorganization of the testdriver 2021-02-01 18:13:19 +01:00
Olivier Goffart
f1491dc724 Remove unused function 2021-02-01 18:13:19 +01:00
Olivier Goffart
efd6a5479c don't make xtask depends on the test driver lib 2021-02-01 18:13:08 +01:00
Simon Hausmann
f33b26fa93 Make Brush compile for C++
A few changes were required:

 * `LinearGradient(LinearGradient)` as enum variant unfortunately
    won't compile because the cbindgen generated constructor
    function (`LinearGradient()`) will try to also instantiate the
    variant type inside (`LinearGradient`) and that won't find the type
    but the function itself and error out. So the inner type is now
    called `LinearGradientBrush`.

 * The same name dance was required for `Color`, where the enum variant
   instead is called `SolidColor`

 * `BrushInner` was removed in favor of just `Brush`. The nicer Rust
    API will be the public variant, and for cbindgen we can just put
    the generated enum into an internal namespace, like we do for
    Resource for example

 * A `NoBrush` variant was added. Maybe that name could be improved?
2021-02-01 16:51:04 +01:00
Simon Hausmann
b90eb04088 Begin with the brush data structure
This patch also adds `extend` to `SharedVector`, for convenience.
2021-02-01 14:45:49 +01:00
Simon Hausmann
b608f3b7c0 Split out the path data structures and functions into a separate module 2021-02-01 13:37:47 +01:00
Simon Hausmann
ee2671fe70 Reduce the size of graphics.rs a little
Split out the color related intos into a module of their own.
2021-02-01 13:22:14 +01:00
Simon Hausmann
326d235ff5 Fix calling focus() on components
Fixes #153
2021-02-01 13:05:08 +01:00
Olivier Goffart
e09fa06226 Fix nested for layouts
Fixes #149
2021-02-01 12:38:56 +01:00
Olivier Goffart
a36edfffbe Change the C++ test API of the send_mouse_click
So that rust and C++ have the same code that can be copy pasted
2021-01-29 16:55:48 +01:00
Olivier Goffart
e2db0e49dc Fix explicit size in box layouts using for
Fixes #147
2021-01-29 16:35:59 +01:00
Olivier Goffart
fea2478859 Update version number everywhere 2021-01-28 16:34:13 +01:00
Olivier Goffart
bed45e879a Upgrade cbindgen 2021-01-28 15:55:27 +01:00
Olivier Goffart
8e8c6ab690 Avoid self-references in the created layout properties
Fixes #140
2021-01-28 15:06:19 +01:00
Simon Hausmann
6a4f2aa572 Added the two missing path sub-elements for quadratic and cubic curves 2021-01-28 14:14:24 +01:00
Simon Hausmann
a6fbc4c05d Add missing MoveTo sub-element for Path 2021-01-28 13:16:25 +01:00
Olivier Goffart
07df517473 Replace $children with @children 2021-01-28 11:55:08 +01:00
Olivier Goffart
23a511b380 Replace img!"..." by @image-url("...") 2021-01-28 11:49:24 +01:00
Simon Hausmann
48b226c017 Fix build after path stroke-width type fix 2021-01-28 09:13:35 +01:00
Simon Hausmann
ab25faa24f Add automatic creation of BoxShadow elements through drop-shadow properties on Rectangles 2021-01-27 19:02:23 +01:00
Simon Hausmann
680995432e Minor fixes to the BoxShadow element
* Use the same property names as `Rectangle`
* Use the same sizing behavior

Also added a "manual" test.
2021-01-27 15:34:27 +01:00
Olivier Goffart
647f7effcd Add TextWrap and TextOverflow enum and corresponding property in Text
Although they ar enot working yet
2021-01-27 11:40:09 +01:00
Olivier Goffart
9de5af75ce Allow FocusScope to reject the events 2021-01-26 17:05:31 +01:00
Olivier Goffart
2e23b5bbdd Handle native callbacks with return value 2021-01-26 17:05:30 +01:00
Simon Hausmann
628e6fdb38 Add a BoxShadow element
This intends to provide a configurable rectangular "drop shadow". The
API is modeled after CSS/HTML5 Canvas where the element can be "bound"
to an existing rectangular shape (geometry and radius), the offset can
be used to place the shadow and color and blur configure the shadow.

The shadow's color fades into transparent.

TODO (in subsequent changes):
 * Documentation
 * Qt implementation
2021-01-26 13:56:12 +01:00
Olivier Goffart
802383cd6b Propagate key event to parent if the item don't handle it
Does not work for C++ because binary compatibility issue
2021-01-26 13:17:04 +01:00
Olivier Goffart
5a21f1bd81 Rename emit_ to call_ for callback
Signal was renamed to Callback, but one does not emit a callback, one calls it
2021-01-25 15:59:10 +01:00
Olivier Goffart
c2dc0cef2c Finish return statement handling 2021-01-25 15:32:00 +01:00
Simon Hausmann
b22bbb1c0f WIP: Implement the return statement 2021-01-25 15:32:00 +01:00
Simon Hausmann
ecedb18333 Fix build
Don't use C++ types as field names for now
2021-01-25 14:40:02 +01:00