Commit graph

451 commits

Author SHA1 Message Date
Simon Hausmann
3b971a2e2f Remove Color::From<u32>
Instead make it clear on the call site what the encoding is (argb).
2020-09-03 11:17:40 +02:00
Olivier Goffart
b2b5645195 Allow property of type object, and conversion between objects 2020-09-03 08:39:23 +02:00
Olivier Goffart
9d405060e2 Parse object and array type 2020-09-03 07:43:20 +02:00
Olivier Goffart
1cf6d81169 Impletment GroupBox with the Qt style 2020-09-02 17:05:28 +02:00
Simon Hausmann
fd5271f2be Rename the WidgetBox in the gallery to GroupBox
... and place it in the ugly style. Then we can also style it through the native style.
2020-09-02 13:49:14 +02:00
Simon Hausmann
6fa010cd53 Improve slider value indication
Do not only use the location of the handle to indicate the value, also
fill the rectangle to the left of it.
2020-09-02 10:37:19 +02:00
Simon Hausmann
4e36567e63 A new color scheme for the ugly widget style 2020-09-02 09:08:49 +02:00
Olivier Goffart
59dbb610be Materialize fake properties such as layout width/height 2020-09-01 18:49:49 +02:00
Olivier Goffart
159d8b615a Some adjustment to the examples in langref 2020-09-01 14:27:00 +02:00
Olivier Goffart
2144975dad Fix setting row in GridLayout with the row property 2020-09-01 14:27:00 +02:00
Olivier Goffart
a36cb2d9b4 Layout: add a padding shorthand property
Also fix a bug in the C++ code generator where two layout have padding
in the same component
2020-09-01 13:29:13 +02:00
Olivier Goffart
9782d85fdb Native style works with C++ 2020-09-01 12:25:11 +02:00
Olivier Goffart
f1ad78bc25 Qt style support for the rust backend
Need to set the SIXTYFPS_STYLE=native env variable while compiling
2020-09-01 12:25:11 +02:00
Olivier Goffart
9d5f27db0b Rename QtStyle to Native 2020-09-01 12:25:11 +02:00
Olivier Goffart
60201b9c7b Update dependencies 2020-08-31 17:38:22 +02:00
Patrick José Pereira
b63852967e sixtyfps_compiler: parser: Move code to use new nth and kind functions
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-08-31 15:02:41 +02:00
Patrick José Pereira
9cd4cb80e2 sixtyfps_compiler: parser: Change nth function of Parser to return Token
Improve the Parser functionality allowing access to the nth Token,
resulting in a much more flexible API.

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-08-31 15:02:41 +02:00
Patrick José Pereira
a7b376fe7b sixtyfps_compiler: parser: Add kind function for Token
This allow access to the private property

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-08-31 15:02:41 +02:00
Patrick José Pereira
b990cccf60 Fix typo in sixtyfps_compiler/passes/resolving
Move typo expresion to expression

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-08-31 14:42:27 +02:00
Olivier Goffart
2bb7616b80 Show in the error message how to perform conversion between units 2020-08-31 10:30:16 +02:00
Simon Hausmann
55764de31d Fix alignment of text in the spin box buttons
Center nicely :-)
2020-08-28 16:41:36 +02:00
Simon Hausmann
a9737d77fc Fix vertical alignment of spinbox text
Same fix as for the checkbox.
2020-08-28 16:36:01 +02:00
Simon Hausmann
d0afe4289e Fix text alignment of checkbox text
Align it vertically
2020-08-28 16:32:51 +02:00
Simon Hausmann
5dbd0b213c Add support for grid layout padding 2020-08-28 15:06:14 +02:00
Simon Hausmann
7976a4057f Improve handling of nested layouts
We support directly nested layouts, but we did not support indirect
nesting:

    GridLayout {
        Rectangle {
            l2 := GridLayout { ... }
        }
    }

This patch fixes that by detecting this scenario and merging the layout
info of the element (Rectangle) and the layout inside (l2). This makes
it much easier to create re-usable components that use layouts
themselves and allows placing them in layouts.
2020-08-28 15:06:14 +02:00
Simon Hausmann
c1aa4b28c6 Add support for children insertion points for components
Sometimes re-usable components need to act as containers that allow the
user to place other items inside. The component needs to be able to
control the placement of these user-provided elements. That is what the
new

    $children

expression inside elements does.
2020-08-28 15:05:21 +02:00
Olivier Goffart
baad6f62bc Fix comments that nest next to eachother 2020-08-28 14:06:27 +02:00
Olivier Goffart
10e8d7ffb9 Replace the regexp-based lexer with a custom lexer
The regexp crate is huge and takes more than a third of the size of the
wasm-interpreter.
2020-08-28 13:34:43 +02:00
Olivier Goffart
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
Simon Hausmann
7fb4c544f9 Fix C++ build 2020-08-25 23:01:20 +02:00
Simon Hausmann
9785919f6e Hide a few APIs from the C++ documentation
Since Doxygen can't seem to just exclude them via command, they are moved
into a private_api namespace and then excluded via Doxygen config:

    * *VTable
    * make_dyn_node, ItemTreeNode, etc.
    * VersionCheck
2020-08-25 17:45:12 +02:00
Simon Hausmann
9dd6101494 Avoid using cbindgen_private in generated C++ code
Instead, pull in the types manually.
2020-08-25 15:36:29 +02:00
Simon Hausmann
14fe897086 Move all cbindgen generated code into
sixtyfps::cbindgen_private

Having private in the name makes it clear that this is ... private,
and cbindgen helps remember that it's generated.
2020-08-25 15:29:48 +02:00
Olivier Goffart
6ad581f2a0 Move the sixtyfps_widgets.60 to the compiler directory
We need to do that because it needs to be in the compiler crates.io package
2020-08-25 12:19:08 +02:00
Olivier Goffart
ea1f215367 Some polishinbg of the .toml files
- Give all the sixtyfps-* create a 0.0.1 version
 - Make sure that the internal dependences are using the exact same version
   (so "=0.0.1")
 - Add the description/homepage/repository fields in the .toml files
 - Set publish=false  to crates that are not meant to be published on crates.io
2020-08-24 16:28:11 +02:00
Olivier Goffart
420fc2dc36 Fix bug in rust code generation for *= 2020-08-24 08:56:10 +02:00
Olivier Goffart
058a91ba75 Fix repeater access to properties within sub components 2020-08-24 08:27:22 +02:00
Simon Hausmann
7f1d9f5252 Commit correct license tags to Cargo.toml
For now that's GPL-3.0 only, but this can be changed :-)
2020-08-18 10:12:59 +02:00
Simon Hausmann
2823f32692 Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
Simon Hausmann
4a74f6d0a3 Implement releasing graphics resources in Rust via Drop
Further enhances #12
2020-08-14 13:44:53 +02:00
Simon Hausmann
3b4bcd51d4 Clean up window field initialization in the Rust generator
Use an option instead of a vector sequence expansion to achieve the effect
of an optional token expansion.
2020-08-14 10:27:49 +02:00
Simon Hausmann
55888afb1c Implement releasing of graphics resources in C++ via the component destructor 2020-08-13 16:35:04 +02:00
Olivier Goffart
fb5a82b6c7 Fix acessing repeater variable in a nested repeater, and fix array as property 2020-08-13 15:38:28 +02:00
Simon Hausmann
fc6c35bb3f
Fix formatting of generated code
Second attempt, remove all trialing spaces
2020-08-13 13:59:05 +02:00
Simon Hausmann
c394a10a85
Remove trailing spaces 2020-08-13 13:51:00 +02:00
Simon Hausmann
d650cadc02 Release graphics resources of items when deleting components in C++ 2020-08-13 13:31:52 +02:00
Simon Hausmann
b96b627a4f Release graphics resources of items when destroying components
This is only implemented for Rust at the moment.
2020-08-13 13:31:29 +02:00
Olivier Goffart
2ddfe76840 Fix bug with mouse input and dynamic models 2020-08-13 10:59:45 +02:00
Olivier Goffart
7e1af72a2e Implement minimum/maximum width/height properties 2020-08-12 14:00:51 +02:00
Olivier Goffart
092411ccef Attempt to merge the layout code between rust and C++
This does not actually merge so much but it is better than nothing.

I was not able to merge the code from the interpreter because of the life time issues
2020-08-12 11:53:39 +02:00