Olivier Goffart
1e9e252400
Fluent style: uniformize the height of widgets
...
Make sure they all have the minimum height based on what is currently
the hardcoded value of the button.
Also inlclude the border top and bottom padding in the layout in case the
font is really big
2022-01-20 10:41:14 +01:00
Simon Hausmann
3d5fbc76fe
Prospective fix for the printer demo not loading in the online editor
...
Commit fa1ac9884d
introduced an early check for the existence
of the specified font files. However we should only do that for local files for now.
2022-01-20 10:37:29 +01:00
Olivier Goffart
1db34682ee
C++: fix crash when closing window
...
the m_window needs to be destroyed after the destructor of the repeater
2022-01-20 08:42:32 +01:00
Simon Hausmann
e2838a87ab
Fix missing calls to init() of native items in repeater item trees when using C++
...
Like in the Rust generator, we need to always call init_items().
2022-01-19 16:56:02 +01:00
Simon Hausmann
fa1ac9884d
Verify the existence of imported custom fonts
...
... and produce diagnostics.
That way in later phases we don't need to check again.
As an unfortunately side-effect, we need to skip one of the examples in
the language reference from the doc test, as the compilation fails
because the font does not exist.
2022-01-19 16:24:22 +01:00
Simon Hausmann
1bacaee68b
Fix stack usage on Windows with Rust debug builds
...
Re-apply commit f7248a4863
to the updated code generator.
This fixes running the gallery on Windows in debug builds with the fluent style.
2022-01-19 16:22:03 +01:00
Simon Hausmann
9bbcf16124
Fix typo
...
Co-authored-by: Olivier Goffart <ogoffart@sixtyfps.io>
2022-01-19 15:42:43 +01:00
Simon Hausmann
1fcfc58975
cpp generator: reduce surface of public C++ API
...
Use Access::Private as access for properties, items, helper fields (tree
index, etc.), and vtable functions of the public component.
All meanwhile added declarations for sub-components (such as popups, child repeaters)
still get access through friendship.
2022-01-19 15:42:43 +01:00
Tobias Hunger
2f6be7b31f
Mass-add copyright headers into Cargo.toml files
2022-01-19 11:25:21 +01:00
Olivier Goffart
f9f90e1b4e
C++: Do not expose private types in the sixtyfps namespace
2022-01-19 11:19:47 +01:00
Simon Hausmann
be83d60bd8
Simplify signature of compiler code generator
...
Remove the unused diagnostics parameter.
2022-01-19 10:02:23 +01:00
Simon Hausmann
12e2aa3941
cpp llr: Simplify generate() signature
...
Since the function always returns Some(), we can remove the Option from the return type.
2022-01-19 10:02:23 +01:00
Tobias Hunger
81d1c8129f
Remove some commented out code
2022-01-19 10:02:23 +01:00
Tobias Hunger
fb3d5ef263
LLR-C++: Implement ShowPopupWindow
2022-01-19 10:02:23 +01:00
Tobias Hunger
638326cb39
Remove useless comment
2022-01-19 10:02:23 +01:00
Simon Hausmann
96a5682fd8
cpp llr: remove some old code that was commented out
2022-01-19 10:02:23 +01:00
Simon Hausmann
3ec6c0fc63
cpp llr: fix disappearing items when rendering repeaters
...
Creating a repeater component would use the same setup code as a public component,
which replaces the component rc in the window among other things.
Handle this in generate_item_tree just like in the Rust generator.
2022-01-19 10:02:23 +01:00
Olivier Goffart
67c6a352ea
llr-cpp: fix a warning in the generated code
2022-01-19 10:02:23 +01:00
Simon Hausmann
569fee695e
cpp llr: fix use of properties of native items in if conditionals
...
InNative assumed that the current sub-compo is accessed using "this",
which happens to also be part of regular binding captures. But it isn't for model binding,
for example.
Let's use "self" throughout, like everywhere else.
2022-01-19 10:02:23 +01:00
Simon Hausmann
5e5622a947
cpp llr: Implement RegisterCustomFontByMemory and RegisterCustomFontByPath
2022-01-19 10:02:23 +01:00
Simon Hausmann
4a89cc106c
llr cpp: fix initial_focus test
...
Don't call set_focus_item() followed by set_component() on the window, which clears the focus item again.
Like in Rust, call set_component first, then init_items() and finally all the init/setup code.
2022-01-19 10:02:23 +01:00
Simon Hausmann
5631098f91
cpp llr: invoke generated sub-component init code
...
The initial focus handling generates setup code, which needs inclusion.
2022-01-19 10:02:23 +01:00
Simon Hausmann
f451e4eaf7
cpp llr: fix set_focus_item builtin method calls
...
End the function call with a semicolon.
2022-01-19 10:02:23 +01:00
Simon Hausmann
c58668a600
cpp llr: fix test_cpp_7gui_timer
...
Port commit 242dfcf7cf
to catch all conversions from numbers to string.
2022-01-19 10:02:23 +01:00
Simon Hausmann
85fa56ac32
cpp llr: minor cleanup
...
Fold unused variables into their use-site
2022-01-19 10:02:23 +01:00
Simon Hausmann
f691d91c06
Fix failing rust test
...
The Close{} element now has a C++ type name, but in the Rust generator we're
not interesting in using that
since PathElement::Close is without fields.
2022-01-19 10:02:23 +01:00
Olivier Goffart
1f3620acfa
llr-cpp: fix crash computing path
...
The events and point were referencing temporaries.
Fix that by passing them as argument to the lambda so the temporaries
don't get destroyed before being used.
2022-01-19 10:02:23 +01:00
Olivier Goffart
35cb9ed338
llr-cpp: Fix Dialog
2022-01-19 10:02:23 +01:00
Olivier Goffart
0259c0dc9b
Give a return type to llr::Expression::ExtraBuiltinFunctionCall
...
Some code in the C++ generator needs the type of such expressions
2022-01-19 10:02:23 +01:00
Simon Hausmann
c2ae82c74f
cpp llr: fix crashes_issue_422_enclosing_component
...
Make sub-compo fields public
2022-01-19 10:02:23 +01:00
Simon Hausmann
80768fd011
cpp llr: fix color and string builtin function calls
2022-01-19 10:02:23 +01:00
Simon Hausmann
44857ff0f2
cpp llr: Fix BuiltinFunction::Debug to stream into std::cout
2022-01-19 10:02:23 +01:00
Olivier Goffart
83136f5bca
llr-cpp: fix test_cpp_properties_property_animation
2022-01-19 10:02:23 +01:00
Simon Hausmann
4a3678fe55
cpp llr: Fix support for the Close {} path element
2022-01-19 10:02:23 +01:00
Olivier Goffart
270d8ab2c7
llr-cpp: Transitions
2022-01-19 10:02:23 +01:00
Simon Hausmann
708c4a55de
cpp llr: add support for path events
2022-01-19 10:02:23 +01:00
Simon Hausmann
7e695ae4e6
cpp llr: add support for path elements
...
This is mostly covered by the cast produced by the llr lowering.
2022-01-19 10:02:23 +01:00
Olivier Goffart
1464da3a68
llr-cpp: Public API for globals
2022-01-19 10:02:23 +01:00
Olivier Goffart
23a2900b66
llr-cpp: init global bindings
2022-01-19 10:02:23 +01:00
Simon Hausmann
34825e0a2b
cpp llr: Fix ensure_updated for listview
2022-01-19 10:02:23 +01:00
Simon Hausmann
7c3f8b78cb
cpp llr: Provide access to user-defined globals
2022-01-19 10:02:23 +01:00
Simon Hausmann
251847d2d0
cpp llr: fix order of sub-components
...
Preserve the declaration provided by used_types, to make sure that we declare
before use. In Rust it doesn't matter, but in C++ it does.
2022-01-19 10:02:23 +01:00
Olivier Goffart
37707ac98e
llr-cpp: Flickable
2022-01-19 10:02:23 +01:00
Olivier Goffart
99adc25a81
llr-cpp: Fix for
within layout
2022-01-19 10:02:23 +01:00
Simon Hausmann
f5459177f3
cpp llr: Implement ModelDataAssignment and ArrayIndexAssignment
...
Also make repeaters friends of the App, for field access.
2022-01-19 10:02:23 +01:00
Olivier Goffart
55f66b36d5
C++: Remove a bunch of commented out code that was already ported
...
Or which is still commented out somewhere else
2022-01-19 10:02:23 +01:00
Simon Hausmann
339dde64f1
cpp llr: fix test_cpp_models_for
...
Make the parent accessible to sub-components
2022-01-19 10:02:23 +01:00
Olivier Goffart
d62b788829
C++: Do wrapper to the layout function
...
That returns and take their argument in a C++-like way instead of by pointer.
2022-01-19 10:02:23 +01:00
Olivier Goffart
b36de552e5
Pass the Padding by value in the layout data struct
...
It can simply be a Copy type anyway.
So there is no more special code needed in the rust (and also in C++) generator for it
2022-01-19 10:02:23 +01:00
Simon Hausmann
4b0ae4d5a1
cpp llr: Fix BuiltinFunction::ArrayLength
...
Evaluate the model only once, and invoke the lambda that tracks the row count and returns it.
2022-01-19 10:02:23 +01:00