ContextMenu: show submenu on hover after a timeout

This means that the parent menu still get the mouse events

Also add the ability to close the menu programmatically
This commit is contained in:
Olivier Goffart 2025-02-07 13:27:32 +01:00 committed by GitHub
parent feb7a864df
commit c0b72cad2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 125 additions and 35 deletions

View file

@ -3806,7 +3806,7 @@ fn compile_builtin_function_call(
{fw_activated}
}}")
};
format!("{window}.show_popup_menu<{popup_id}>({globals}, {position}, {{ {context_menu_rc} }}, [self](auto popup_menu) {{ {init} }})", globals = ctx.generator_state.global_access)
format!("{window}.close_popup({context_menu}.popup_id); {context_menu}.popup_id = {window}.show_popup_menu<{popup_id}>({globals}, {position}, {{ {context_menu_rc} }}, [self](auto popup_menu) {{ {init} }})", globals = ctx.generator_state.global_access)
}
BuiltinFunction::SetSelectionOffsets => {
if let [llr::Expression::PropertyReference(pr), from, to] = arguments {