mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
viewer: use the new Compiler API and add a --component
command line arg
This commit is contained in:
parent
875d20f1ac
commit
708ab9f7c2
5 changed files with 70 additions and 27 deletions
|
@ -248,9 +248,9 @@ impl Document {
|
|||
self.exports
|
||||
.iter()
|
||||
.filter_map(|e| Some((&e.0.name_ident, e.1.as_ref().left()?)))
|
||||
.filter(|(_, c)| !c.is_global())
|
||||
.max_by_key(|(n, _)| n.text_range().end())
|
||||
.map(|(_, c)| c.clone())
|
||||
.or_else(|| self.exported_roots().last())
|
||||
}
|
||||
|
||||
/// visit all root and used component (including globals)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue