slint/api/cpp/include
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
..
slint-interpreter.h WIP: live-reload for C++ 2025-07-09 09:32:17 +02:00
slint-platform.h Fix typos (#8421) 2025-05-12 13:03:59 +02:00
slint-stm32.h Revert "stm32: Fix compilation with newer STM BSPs" 2025-02-08 23:18:08 +01:00
slint-testing.h Fix typos (#8421) 2025-05-12 13:03:59 +02:00
slint.h C++: adapt to menu bar API change 2025-07-29 16:53:57 +02:00
slint_brush.h Add conic gradient support for all backends (#9021) 2025-08-02 09:14:33 +02:00
slint_callbacks.h Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
slint_color.h Fix C++ compilation 2025-06-26 18:45:37 +02:00
slint_config.h Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
slint_image.h Changelog: C++: Add slint::Window::take_snapshot() 2024-11-13 12:38:36 +01:00
slint_interpreter.h Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
slint_item_tree.h C++: move model code to its own file 2025-03-25 10:37:20 +01:00
slint_live_reload.h C++ live-reload: support getting the model back 2025-07-09 11:23:33 +02:00
slint_models.h C++: make sure we do not crash if a Model::row_data returns nullopt 2025-05-30 15:47:13 +02:00
slint_pathdata.h Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
slint_point.h infra: Test out mise 2025-03-20 16:33:00 +01:00
slint_properties.h Fix C++ compilation 2025-06-26 18:45:37 +02:00
slint_sharedvector.h Re-run clang-format with version 18 2024-06-10 02:25:40 -07:00
slint_size.h Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
slint_string.h C++: Add clear() method to SharedString (#8797) 2025-06-27 13:44:37 +02:00
slint_tests_helpers.h Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
slint_timer.h C++: add asserts that we are in the main thread 2025-05-28 11:29:48 +02:00
slint_window.h Simplify menu handling 2025-08-15 12:07:46 +02:00
vtable.h C++: adapt to menu bar API change 2025-07-29 16:53:57 +02:00