Commit graph

497 commits

Author SHA1 Message Date
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
b75e135459 Support complex product of units
Fixes #68
2021-02-04 12:56:14 +01:00
Olivier Goffart
4643706409 Make sure linear gradiant always have all its stops 2021-02-03 15:42:35 +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
Simon Hausmann
e8b64be9bd Issue a warning when accessing a deprecated property through component scopes 2021-02-03 08:03:01 +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
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
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
e2db0e49dc Fix explicit size in box layouts using for
Fixes #147
2021-01-29 16:35:59 +01:00
Olivier Goffart
97917c43db Fix selecting the minimal class when no properties are used
Otherwise `Rectangle{}`  would be a BorderRectangle
2021-01-28 18:52:39 +01:00
Olivier Goffart
82aa658cef Update rowan 2021-01-28 15:37:01 +01:00
Olivier Goffart
bb4212f0aa Remove bang macro support 2021-01-28 11:49:24 +01:00
Olivier Goffart
5debc08f98 Parse @image-url 2021-01-28 11:49:24 +01:00
Simon Hausmann
f8eec03296 Allow drop-shadow on Clip
Commit d03da6b57b illustrates how this
would be rather convenient. Eventually perhaps `Clip` can turn into a
boolean `clip: true` property.
2021-01-28 08:40:09 +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
Olivier Goffart
edcd4b1d0b Move the generate_item_indices function in a a passes modules 2021-01-27 09:21:26 +01:00
Olivier Goffart
397ccf518a Properly error when the return value of a signal is missing 2021-01-26 17:18:01 +01:00
Olivier Goffart
9de5af75ce Allow FocusScope to reject the events 2021-01-26 17:05:31 +01:00
Olivier Goffart
7ac219e6d2 Return statement: check that the return type is correct 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
f502be9299 Fix nested structures
When the nested structure was only referenced indirectly, we weren't collecting it for code generation.
2021-01-25 14:12:24 +01:00
Simon Hausmann
7ef8a866d9 Add support for qualified enum lookups 2021-01-25 10:44:17 +01:00
Simon Hausmann
1bf5a56c39 Rename initial-focus to forward-focus 2021-01-20 15:52:58 +01:00
Simon Hausmann
f7ea2a9dce Forward focus() calls on items that have initial-focus defined
This also makes the focus() method available as a member function on any
item, but the resolve_element_reference_in_set_focus_calls() pass will
check if the elements are valid.

The check for `has-focus` to determine a focusable item was replaced
with an annotation on the built-in elements, so that `has-focus` can
later be implemented as a built-in function through the run-time,
without the need for a boolean property.
2021-01-20 14:31:01 +01:00
Olivier Goffart
38a3c0655c Add support for \u{xxx} escape sequences in stirng literal 2021-01-20 09:11:06 +01:00
Olivier Goffart
8dc79699de String template concatenation
Currently not supported in the sixtyfps macro
2021-01-18 16:09:58 +01:00
Olivier Goffart
ba6ff5736c String Escaping 2021-01-18 13:36:23 +01:00
Simon Hausmann
1b34b7f90b Simplify img! relative path resolution logic a little
Amend commit 3e90a3c827 by using
unwrap_or_else() instead of if {} else {}
2021-01-18 08:43:18 +01:00
Simon Hausmann
58768bf70a Add default bindings for width/height for Image and Text to their implicit size 2021-01-15 17:58:32 +01:00
Simon Hausmann
3e90a3c827 Improve relative image path resolution
Don't just try to resolve relative paths against the current path,
resolve them against all directories in the include search path.

Together with the include search path directive for tests in tests/cases
this will allow working around the fact that the base directory for the
rust tests is different than for the C++/NodeJS tests.
2021-01-15 16:28:17 +01:00
Olivier Goffart
0d2d48be4f Rename "signal" to "callback" 2020-12-18 09:51:01 +01:00
Olivier Goffart
7f78bea8b5 Fix a bunch of cargo clippy warnings in the compiler 2020-12-07 12:54:38 +01:00
Olivier Goffart
a37a287a17 Limit the conversion from percentage to lenght for the width and height property 2020-12-04 11:20:09 +01:00
Olivier Goffart
f3f18259ae Some items default size is the parent size
Fixes #122
2020-12-02 18:36:23 +01:00
Olivier Goffart
ac3ce779e9 Make child_of_layout actually mean what it is named after 2020-12-02 18:36:23 +01:00
Olivier Goffart
276e11a101 More work on signals with return value 2020-12-01 18:47:49 +01:00
Simon Hausmann
133823ca4c Apply the object literal type merging also to the binary comparison operator 2020-12-01 10:57:47 +01:00
Simon Hausmann
798b08f2b1 Use smarter common-type determination code also for conditional expressions
This requires two changes to the function:

    (1) When we can't convert to one type to the other, try the reverse.
    (2) When merging fields, apply the algorithm recursively for common fields.
2020-12-01 10:57:47 +01:00
Simon Hausmann
9360fc3c5a Don't silently drop fields in object literals inside arrays
This patch tries to improve the ability to convert different kinds of
object literals in an array into a common type. We used to take the
first entry as the "shape" of all elements, which meant that if the
first element was missing a field it would be silently dropped from all
future fields.

Instead, this patch merges the fields.
2020-12-01 10:57:47 +01:00
Olivier Goffart
a973791676 Fix move property inside a popup 2020-11-30 18:39:41 +01:00
Olivier Goffart
7bfa998f00 Popup positioning 2020-11-30 18:39:41 +01:00