slint/internal/compiler/llr
Olivier Goffart fb9a2c0f47 Simplify menu handling
Previously there were two kinds of Menu:
  1. "Simple" menu that don't have any `if` or `for`
  2. "Complex" menu that have `if` and `for`

For the first kind, we were generating in the compiler the `entries` and
`sub-menu` callback. This lead to more efficient and simple code at
runtime.
For the second kind, we generate an item tree so we can dynamically
produce them at runtime.

The issue is that as we added feature, the code became complex to
handle, even in the simple case as we need to create a `VRc<MenuVTable>`
also for the context menu so we can have native context menu.

We still need the "Simple" case for the internal though.
So for that I added a ShowPopupMenuInternal builtin function although it
only differ from ShowPopupMenu by the type of its second argument.
Since the generated code has lots in common, they are still handled
together.

The proof that the two different codepath were harmful is that removing
it showed a bug with contextmenu within repeated element.
the `contextmenu_delete.slint` started failling. It worked before
because it was only a problem with "Complex" menu and the test used a
"Simple" menu.

The change in the interpreter should also solve the issue #9031 which
were using the wrong item tree as the menu.
2025-08-15 12:07:46 +02:00
..
optim_passes Simplify menu handling 2025-08-15 12:07:46 +02:00
expression.rs Compiler: Fix visiting assignement on animated properties in parent 2025-08-04 15:09:10 +02:00
item_tree.rs core: Fix the component container 2025-06-05 13:48:16 +02:00
lower_expression.rs Add conic gradient support for all backends (#9021) 2025-08-02 09:14:33 +02:00
lower_to_item_tree.rs Fix warning with nightly about unnecessary parentheses 2025-07-11 08:26:30 +02:00
pretty_print.rs Add conic gradient support for all backends (#9021) 2025-08-02 09:14:33 +02:00