mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Generate multiple components in Rust and C++ (#5449)
When lowering to the LLR, generate one PulbicComponent for each exported component in the main file Closes #784
This commit is contained in:
parent
c89ea56abb
commit
3764312561
18 changed files with 257 additions and 167 deletions
|
@ -326,7 +326,7 @@ mod cpp_ast {
|
|||
}
|
||||
|
||||
use crate::expression_tree::{BuiltinFunction, EasingCurve, MinMaxOp};
|
||||
use crate::langtype::{ElementType, Enumeration, EnumerationValue, NativeClass, Type};
|
||||
use crate::langtype::{Enumeration, EnumerationValue, NativeClass, Type};
|
||||
use crate::layout::Orientation;
|
||||
use crate::llr::{
|
||||
self, EvaluationContext as llr_EvaluationContext, ParentCtx as llr_ParentCtx,
|
||||
|
@ -761,14 +761,6 @@ pub fn generate(
|
|||
}
|
||||
}
|
||||
|
||||
if matches!(
|
||||
doc.root_component.root_element.borrow().base_type,
|
||||
ElementType::Error | ElementType::Global
|
||||
) {
|
||||
// empty document, nothing to generate
|
||||
return file;
|
||||
}
|
||||
|
||||
let llr = llr::lower_to_item_tree::lower_to_item_tree(&doc, compiler_config);
|
||||
|
||||
// Forward-declare the root so that sub-components can access singletons, the window, etc.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue