Fix a bunch more issue with PopupWindow

* Make sure that the compiler don't panic if the parent of a PopupWindow
   is optimized (by not optiizing such element)

 * Ensure that we can call popup.show() from within a deeper repeater

 * Ensure that the parent element of the popup is the right one in case of
   repeater (and not the node in the parent component)

This partially revert ad5991f8fa and
6c7a7aed0e because we must do the lower_popup
adter the repeater pass, because otherwise the parent element of the
created component for the PopupWindow might be wrong and it is not easy to
adjust (we would have to make Component::parent_element a RefCell or duplicate
it again.

Fixes #1132
This commit is contained in:
Olivier Goffart 2022-04-01 12:17:12 +02:00 committed by Olivier Goffart
parent a329f052ea
commit f8f61dc2b7
10 changed files with 62 additions and 35 deletions

View file

@ -458,6 +458,10 @@ pub struct Element {
/// true if this Element is the fake Flickable viewport
pub is_flickable_viewport: bool,
/// true if this Element may have a popup as child meaning it cannot be optimized
/// because the popup references it.
pub has_popup_child: bool,
/// This is the component-local index of this item in the item tree array.
/// It is generated after the last pass and before the generators run.
pub item_index: once_cell::unsync::OnceCell<usize>,