Fixed infinite loop due to variable shadowing.

Fmt.
This commit is contained in:
Well 2024-01-05 18:57:42 -03:00
parent 67978312fe
commit f744174ec1
5 changed files with 5 additions and 10 deletions

View File

@ -1,8 +1,3 @@
# Context Menu
* Opening and closing a ContextMenu by clicking on the window causes the app to become stuck.
- Does not print update trace.
# TextInput
* Implement selection toolbar.

View File

@ -482,8 +482,8 @@ mod context {
use zero_ui::{
app::{AppExtended, AppExtension, HeadlessApp},
prelude::*,
var::{AnyWhenVarBuilder, ContextInitHandle},
prelude_wgt::*,
var::{AnyWhenVarBuilder, ContextInitHandle},
};
context_var! {

View File

@ -159,8 +159,8 @@ pub fn sub_menu_popup_node(children: ArcNodeList<BoxedUiNodeList>, parent: Optio
}
UiNodeOp::Info { info } => {
// sub-menus set the popup as parent in context menu.
let parent = Some(parent.unwrap_or_else(|| WIDGET.id()));
super::sub::SUB_MENU_PARENT_CTX.with_context(&mut Some(Arc::new(parent)), || c.info(info));
let parent_ctx = Some(parent.unwrap_or_else(|| WIDGET.id()));
super::sub::SUB_MENU_PARENT_CTX.with_context(&mut Some(Arc::new(parent_ctx)), || c.info(info));
info.set_meta(&super::sub::SUB_MENU_POPUP_ID, super::sub::SubMenuPopupInfo { parent });
}
UiNodeOp::Event { update } => {