mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 10:23:32 +00:00
![]() When a component declares an init callback as well as the element that instantiates it, the init callback of the container would not get invoked if the container was inlined: ``` component InlinedContainer { init => { ... } // not invoked @children // force inlining } component UseSite { InlinedContainer { init => { ... } } } ``` That's because the inlining happens very early, before the init callbacks are collected into the init code. And during inlining that would be treated like a property binding and the "binding" at the element site overrides the one at the component site. One natural approach would be to move the init code collection to an earlier place before inlining, but that isn't possible because the boundaries of the compiler components (Rc<Component>) aren't set up yet (repeated component extraction phase happens much later). An alternative would be to re-introduce the init callback code in ElementRc and place it in there at *::from_node() time. This patch chooses to solve this at the inlining time: When we're in the first phase of the inlining (the optional one), do what with the init binding what collect_init_code would do later: Move it straight into the init_code of the component we're inlining into. Fixes #4317 |
||
---|---|---|
.. | ||
generator | ||
LICENSES | ||
llr | ||
parser | ||
parser-test-macro | ||
passes | ||
tests | ||
widgets | ||
build.rs | ||
builtin_macros.rs | ||
builtins.slint | ||
Cargo.toml | ||
diagnostics.rs | ||
embedded_resources.rs | ||
expression_tree.rs | ||
fileaccess.rs | ||
generator.rs | ||
langtype.rs | ||
layout.rs | ||
lexer.rs | ||
lib.rs | ||
literals.rs | ||
llr.rs | ||
load_builtins.rs | ||
lookup.rs | ||
namedreference.rs | ||
object_tree.rs | ||
parser.rs | ||
passes.rs | ||
pathutils.rs | ||
README.md | ||
typeloader.rs | ||
typeregister.rs |
The Slint Compiler Library
NOTE: This library is an internal crate of the Slint project.
This crate should not be used directly by applications using Slint.
You should use the slint
crate instead.
WARNING: This crate does not follow the semver convention for versioning and can
only be used with version = "=x.y.z"
in Cargo.toml.