Simon Hausmann
fcc819e395
Add support for enums to the compiler
...
This replaces the duplicated text alignment enums
2020-08-07 13:15:43 +02:00
Simon Hausmann
aecf6a8878
Center text in buttons in the demo and gallery
...
This adds horizontal_alignment/vertical_alignment properties, along with
width/height to Text.
This still uses a hard-coded enumeration in the compiler, which is meant
to go away in favor of general enum support.
2020-08-07 10:02:52 +02:00
Olivier Goffart
479173c22f
Implement spacing in GridLayout
2020-08-05 15:42:38 +02:00
Olivier Goffart
2518af41b1
Fix for
in a declared component
2020-08-04 18:51:39 +02:00
Olivier Goffart
0199b70cea
if
statements
2020-08-04 17:36:20 +02:00
Simon Hausmann
254df328d0
Add support for images (resources) in models
...
This also allows replacing the emojis (not working due to lack of fallback) with images
2020-08-04 16:09:33 +02:00
Simon Hausmann
7277d15394
Provide a better error message when failing to convert a type to C++
2020-08-04 15:04:18 +02:00
Simon Hausmann
41671e3efb
Represent the window scale factor conversions in the IR
...
That means less code in the generators and easier to extend in the
future with more built-in functions.
2020-08-04 12:49:37 +02:00
Olivier Goffart
2b9e529af7
Fix unicode in strings in C++
2020-08-04 11:52:47 +02:00
Simon Hausmann
4f0bf0b982
Rename dpi to (window) scale_factor
2020-08-04 09:01:30 +02:00
Olivier Goffart
d7bb993d7b
Fix clang warnings
2020-08-03 18:46:11 +02:00
Olivier Goffart
da11b33e9b
Version check
...
Compilation error when the compiler and the runtime are not on the same version
2020-08-03 18:44:36 +02:00
Olivier Goffart
b2a1a72450
C++: add on_* funciton to connect to signals
2020-08-03 15:01:10 +02:00
Olivier Goffart
a4efac920a
C++: make all properties and sub elements private
2020-08-03 15:01:10 +02:00
Simon Hausmann
480a8470f5
Remove dead code
2020-07-30 19:51:33 +02:00
Simon Hausmann
cb7aca54d4
Implement support for nested layouts in the C++ generator
2020-07-30 19:41:38 +02:00
Olivier Goffart
9760cf4969
Begin to implement a Flickable
...
The implementation is still very rough and will need to be improved
2020-07-30 14:36:21 +02:00
Simon Hausmann
e881d89bf9
Get rid of visible x/y properties in GridLayout
...
It doesn't really make sense to have them in the API, the grid layout is
supposed to "own" the surrounding space. That can be an element and then
it should be a (0, 0) and distribute the element's width/height, or in
the future it can be a cell of a grid layout. Then there's an (x/y), but
that's implicit / hidden.
2020-07-29 18:52:22 +02:00
Simon Hausmann
4fccbba29d
Prepare for "virtualizing" the grid layout's width/height
...
Instead of storing the "within" element that we unconditionally take the
"width" and "height" properties from, let's pass through a property
reference expression to the width/height to use. For now that's still
the layout parent's width/height, but with this it can be replaced in
the future to refer to a "virtual" property that belongs to parent cell.
2020-07-29 18:52:22 +02:00
Simon Hausmann
00271a3746
Extend the layout data structure in the compiler to allow nesting
2020-07-29 18:52:22 +02:00
Simon Hausmann
f853843bc4
Store layouts in a common enum and vector
...
That'll make it easier later to allow for nesting them.
2020-07-29 18:52:02 +02:00
Olivier Goffart
edd9575b53
Add easing curve in the C++ backend
2020-07-29 15:29:55 +02:00
Olivier Goffart
feec73674f
Start implementing easing curve
2020-07-29 15:19:41 +02:00
Olivier Goffart
f02512f467
Allow to get the span of a binding
2020-07-28 18:02:23 +02:00
Olivier Goffart
b57f3775c9
Refactor GridLayout
2020-07-28 10:31:05 +02:00
Simon Hausmann
88fb491837
Add support for mapping elements to different native classes
...
The Rectangle element has properties for a border outline. If those are
used, then the generated code should use BorderRectangle. But if they are
not used, then we can fall back to just generating a Rectangle.
2020-07-24 17:48:19 +02:00
Simon Hausmann
6c27451761
Begin separating builtin elements from the underlying types
...
This uses a NativeClass type in the registry to represent the underlying
Rust/C++ types.
2020-07-24 16:11:46 +02:00
Olivier Goffart
f87a3e2c13
Assignment operator
2020-07-24 11:43:23 +02:00
Olivier Goffart
05c5f7c53d
Test and fix animations on properties
...
The animation should not start when the property is initialized, only when the
property is set by the setter
2020-07-23 11:45:34 +02:00
Olivier Goffart
1a1d3dbec0
Store two consecutive read of the same variable in a temporary variable
...
Avoid to create too many dependencies when not required.
Especially the state transformation can create a lots of read to the same property
2020-07-22 17:24:26 +02:00
Simon Hausmann
f8c0eb0bd6
Prepare for passing passing more information from syntax node to diagnostics
...
Let the bulk of the push_error() calls take a Spanned trait impl, so
that we can pass node on the call sites. Then when later change the
underyling trait to pass something that can also provide the source file
and we don't have to change all call sites again.
2020-07-20 16:01:15 +02:00
Simon Hausmann
0cb59381e4
Fix type of PropertyDeclaration::type_location
...
In preparation for passing through the source file, avoid storing the Span
in the object tree and instead store the syntax node.
2020-07-20 15:36:17 +02:00
Olivier Goffart
6c54dfb67d
Layout the item in a PathLayout if they are part of a repeater
2020-07-17 15:00:12 +02:00
Simon Hausmann
ada5f68908
Add aggregating BuildDiagnostics
...
This type aggregates different per-file diagnostics into a similar interface,
in preparation for reporting diagnostics from multiple source files.
2020-07-17 12:10:25 +02:00
Simon Hausmann
e914715d88
Rename Diagnostics to FileDiagnostics
...
As this structure holds the diagnostics just for one file.
2020-07-16 18:25:42 +02:00
Olivier Goffart
5e7d5369aa
Few fixes to the layout and add a test that the items are well positioned
2020-07-16 17:22:29 +02:00
Olivier Goffart
96cfd8a620
Fix property named "value" in C++, and fix comparison of lenght in rust
2020-07-16 17:22:29 +02:00
Olivier Goffart
dfd4a35e35
Set the DPI property according to the window's screen
2020-07-15 18:46:55 +02:00
Olivier Goffart
1dec276002
Continue adapting the window size
...
Implement the Rust and C++ part
2020-07-15 17:52:14 +02:00
Olivier Goffart
96e5738785
Add a DPI variable in the interpreter and in the C++ backend
2020-07-15 17:13:23 +02:00
Olivier Goffart
24033ecdc3
Support for logical_lenght type
2020-07-15 11:53:19 +02:00
Olivier Goffart
8e7e3aaa7a
Make the length its own unit
2020-07-14 17:45:03 +02:00
Olivier Goffart
952ddda7c4
Force duration to have an unit
2020-07-14 16:18:12 +02:00
Simon Hausmann
39359a4e26
Add support for an offset to PathLayout
...
This allows animating items on their position along the path.
2020-07-14 15:12:03 +02:00
Olivier Goffart
c30aa370f3
Parse units
...
They currently have no real meaning
2020-07-14 11:35:45 +02:00
Simon Hausmann
a3f365417c
Center items on a path layout
2020-07-14 09:43:59 +02:00
Olivier Goffart
e00491811b
Get rid of the context in properties/signal
2020-07-13 18:49:06 +02:00
Simon Hausmann
992f990fa8
Allow for fitting paths into a given bounding rectangle
...
... by applying a transformation. This allows designing a path in some
other path design tool and then make it fit using bindings.
2020-07-13 15:41:11 +02:00
Simon Hausmann
79ba943882
Allow for positioning grid layouts as well
2020-07-13 14:02:53 +02:00
Simon Hausmann
f6761e2c4c
Allow for the positioning of PathLayouts via x/y properties
...
These are just "virtual" properties that will be transformed into
property members of the main struct through the optimized elements
sub-pass.
2020-07-13 13:34:04 +02:00