Commit graph

948 commits

Author SHA1 Message Date
Simon Hausmann
c29791fbaa Replace a few qualified abi::primitives paths with uses
That'll make it easier to do the next rename :-)
2020-08-03 10:13:32 +02:00
Simon Hausmann
44109130f0 Rename corelib_macro to corelib-macros 2020-08-03 10:01:58 +02:00
Simon Hausmann
6c5d423cd4 Rename sixtyfps_corelib to sixtyfps-corelib 2020-08-03 10:01:58 +02:00
Olivier Goffart
2e74fa43cd Use pin-weak from crates.io 2020-08-03 09:18:04 +02:00
Olivier Goffart
cb67e40c32 Rename WeakPin -> PinWeak 2020-07-31 18:19:26 +02:00
Olivier Goffart
75671c18e7 Rename weak-pin crate to pin-weak 2020-07-31 18:18:12 +02:00
Olivier Goffart
77cf1e1e83 Some documentation change following today review 2020-07-31 16:28:59 +02:00
Olivier Goffart
678f426bfd Review of langref.md 2020-07-31 16:12:37 +02:00
Simon Hausmann
480a8470f5 Remove dead code 2020-07-30 19:51:33 +02:00
Simon Hausmann
0bc5f38a4c Added a test case for a nested grid layout 2020-07-30 19:41:45 +02:00
Simon Hausmann
cb7aca54d4 Implement support for nested layouts in the C++ generator 2020-07-30 19:41:38 +02:00
Simon Hausmann
884af3c88f Implement support for nested layouts in the Rust generator 2020-07-30 19:41:29 +02:00
Simon Hausmann
1265c7f3d1 Fix crash with path layouts in the interpreter 2020-07-30 15:32:24 +02:00
Simon Hausmann
3f58d011c2 Add support for nested grid layouts to the interpreter 2020-07-30 14:46:08 +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
c32114cee6 Add helper function to calculate the layout info for a grid layout
The minimum/maximum widths/heights are the sum of the cells.
2020-07-30 10:25:08 +02:00
Simon Hausmann
94433b9bf1 Implement get_property_ref for Layouts in the interpreter
We can fetch the Property<> references from the custom_properties hash
by using the property name that was changed in the moving declarations
pass.
2020-07-30 10:24:03 +02:00
Simon Hausmann
e0c9f9a71d Parse nested grid layouts
They don't work at run-time yet though.
2020-07-30 10:22:29 +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
8f8971f321 Move the grid and path layout extraction code into separate helper function
That'll make it easier to call them for nested layouts.
2020-07-29 18:52:22 +02:00
Simon Hausmann
30acb11362 Fix handling of properties of nested optimized layout elements
We need to traverse also into the expressions of nested layouts to ensure
any references inside are updated as the
"virtual" properties are moved.
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
Simon Hausmann
89648a8146 Automate the test case for the grid layout 2020-07-29 18:51:26 +02:00
Olivier Goffart
edd9575b53 Add easing curve in the C++ backend 2020-07-29 15:29:55 +02:00
Olivier Goffart
46a011683f Implement easing curve in the runtime 2020-07-29 15:20:28 +02:00
Olivier Goffart
feec73674f Start implementing easing curve 2020-07-29 15:19:41 +02:00
Simon Hausmann
033a1be207 Bump font-kit 2020-07-28 23:03:18 +02:00
Olivier Goffart
733f44f50b Error when using a layout property outside of a layout 2020-07-28 18:24:36 +02:00
Olivier Goffart
5b2add75e4 Parse the row/col/rowspan/colspan in a layout 2020-07-28 18:04:16 +02:00
Olivier Goffart
f02512f467 Allow to get the span of a binding 2020-07-28 18:02:23 +02:00
Simon Hausmann
c847a7b924 Fix values of width/height properties on initial show on macOS 2020-07-28 14:45:17 +02:00
Simon Hausmann
893124d64e Minor cleanup in glyph cache code
Merge string_to_glyphs and layout_glyphs -- they only make sense together here.
2020-07-28 14:22:34 +02:00
Simon Hausmann
cd77171bbc Move all glyph cache related code into one module 2020-07-28 14:22:34 +02:00
Simon Hausmann
c102fca828 Move the glyph rasterization code into the new font module in corelib 2020-07-28 14:22:34 +02:00
Olivier Goffart
604359f01f Put the gallery in a layout 2020-07-28 10:44:17 +02:00
Olivier Goffart
96a2efcb93 Only recompute the layout when needed 2020-07-28 10:43:06 +02:00
Olivier Goffart
b57f3775c9 Refactor GridLayout 2020-07-28 10:31:05 +02:00
Olivier Goffart
0a722c86b3 Implement layouting_info for everything 2020-07-28 10:31:05 +02:00
Simon Hausmann
4d645dd9a3 Remove fake string_to_glyphs implementation for canvas text
We don't need it
2020-07-28 09:39:31 +02:00
Simon Hausmann
c88a4c44ab Minor cleanup in fontkit code
I think I've found the right placement of lifetime specifiers to fix
string_to_glyphs() to return an iterator instead of allocating a vector :-)
2020-07-28 09:32:18 +02:00
Simon Hausmann
b69afa88d7 Minor cleanup in font handling
The mutability of the font cache should be an implementation detail. Makes the API easier :)
2020-07-28 09:28:43 +02:00
Simon Hausmann
09cae799d3 Fix return type of compile_syntax_node
All call sites are only interested in the root component, so might
as well return that.
2020-07-28 09:21:32 +02:00
Simon Hausmann
2425c366db Fix build without Qt, part 2
A really clean build still brough up the issue that the C++ code was failing to build.
Instead, guard those places with #cfg just in the style crate and provide
"empty" items otherwise. That also simplifies the usage site again.

This time tested with git clean -fdx :-)
2020-07-28 08:58:13 +02:00
Simon Hausmann
8a2ff4fd5f Provide a basic implementation of layout_info for Text
This also starts moving the rendering independent part of the font handling
to corelib. The next step will be to adapt the rendering code to use that
instead of its own.
2020-07-27 21:36:58 +02:00
Simon Hausmann
b07f577aa4 Fix build without Qt
If we can't find qmake, don't use the qt_style crate
2020-07-27 15:26:13 +02:00
Olivier Goffart
def42ba3df Add reserved properties that every item has
These properties are materialized if used
2020-07-27 12:18:55 +02:00
Simon Hausmann
a4938c4d8e Add wasm boilerplate 2020-07-25 17:34:59 +02:00
Olivier Goffart
2739ce1e19 CI: Set the LD_LIBRARY_PATH 2020-07-25 15:58:04 +02:00