Commit graph

963 commits

Author SHA1 Message Date
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
Olivier Goffart
d49532182a Fix test_cpp_expr_trigo on windows
Too difficult to access PI in C++ in a cross platform way.
It is simpler get the value from rust.
2021-02-08 14:59:54 +01:00
Olivier Goffart
431ce88326 sin/cos/tan and asin/acos/atan 2021-02-08 12:23:31 +01:00
Olivier Goffart
a8475d062c Fix the priority when inlining and improve debug output
This is just an improvement on 55726cc10d
but is not yet a complete fix for #161, because we do not merge all
bindings that still need to be merged
2021-02-08 10:17:35 +01:00
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
afbb537bc1 Add TouchArea::enabled
and use it in the ugly style
2021-02-05 14:21:20 +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
9bdb793ec1 Rename Window::color to background 2021-02-05 09:38:40 +01:00
Olivier Goffart
0e2471f76b Image::colorize support
(Qt only)
2021-02-04 17:44:01 +01:00
Simon Hausmann
3f541972ef Change Rectangle::border-color to be a brush
This allows things like filling a thick border with a gradient.
2021-02-04 17:05:00 +01:00
Simon Hausmann
50d9211e0a Fix failing default_color.60 test
Allow converting a brush to a color. In the case of a gradient, the color of the first stop is returned.

For the C++ generator this requires adding the extra case of explicitly
calling the `Brush(const Color &)` constructor, despite it being implicit,
in order to generate the correct code when we have IR that casts twice:

```
   Expression::Cast {
       from: Expression::Cast {
           from: Expression::Cast {
               from: Expression::NumberLiteral(...),
               to: Type::Color,
           }
           to: Type::Brush,
       },
       to: Type::Color,
   }
```
2021-02-04 13:44:10 +01:00
Olivier Goffart
b75e135459 Support complex product of units
Fixes #68
2021-02-04 12:56:14 +01:00
Olivier Goffart
684bd7bae2 Fix compilation after color->brush change
builtin expressions need to be converted to the right type.
(In this case: color -> brush)
2021-02-04 12:56:14 +01:00
Simon Hausmann
1a9419638d Change the type of the color property for Text and TextInput to be a brush
This allows filling glyphs with gradients. However femtovg
appears to apply the start/end position per-glyph
instead of globally - resulting in a different result than Qt.
2021-02-04 11:54:57 +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
Olivier Goffart
4643706409 Make sure linear gradiant always have all its stops 2021-02-03 15:42:35 +01:00
Simon Hausmann
262eb00af4 Allow an implicit conversion from a color or a linear gradient to Brush in C++ 2021-02-03 14:42:21 +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
3854d1236a Fix syntax tests 2021-02-03 13:17:57 +01:00
Simon Hausmann
6a1819e4fd Fix the type of Expression::LinearGradient
This allows assigning @linear-gradient to brush properties
2021-02-03 13:09:58 +01:00
Simon Hausmann
94f24d1adc Allow parsing linear gradients when the target property is a brush 2021-02-03 13:09:58 +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
d90fce9c1d Generate linear gradient in C++ 2021-02-03 10:16:23 +01:00
Olivier Goffart
c5ab214f55 Generate linear gradients in rust.rs 2021-02-03 09:52:38 +01:00
Simon Hausmann
e8b64be9bd Issue a warning when accessing a deprecated property through component scopes 2021-02-03 08:03:01 +01:00
Simon Hausmann
c771bcff45 Print a warning when trying to animate deprecated properties 2021-02-02 22:58:54 +01:00
Simon Hausmann
246398fcb3 Issue a warning when accessing deprecated properties through member lookups 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
Simon Hausmann
1f091cb1c0 Rename Rectangle.color to Rectangle.background
Add support for built-in property aliases and rename `color` to
`background` - in preparation for it also changing to type brush.

Right now the alias is silent, a deprecation and overall change
will come in a subsequent change.
2021-02-02 17:01:12 +01:00
Olivier Goffart
c479fd132d Fix panic when @children is in the last component
Throw an error instead

Fixes #148
2021-02-02 16:44:09 +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
e37fe371ac Silence warning about unread value 2021-02-02 09:03:31 +01:00
Olivier Goffart
ad1e18764a Make angle its own type 2021-02-01 14:49:25 +01:00
Olivier Goffart
2d12e118ac Resolve linear gradients 2021-02-01 14:25:27 +01:00
Olivier Goffart
8ab713c681 Parse @linear-gradient(...) 2021-02-01 14:25:27 +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
2fc9893f1d Fix shadow for elements in repeater in a layout
The child_of_layout needs to be moved to teh right element
2021-02-01 11:55:05 +01:00
Olivier Goffart
b91f945a07 Fix horizontal scrollbar in ugly style
the new rendering backend behavior is different if the border radius is bigger
than the small border
2021-01-29 17:41:39 +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
55fae15080 Debuging aid 2021-01-29 16:35:59 +01:00