slint/internal/compiler
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
..
generator Simplify menu handling 2025-08-15 12:07:46 +02:00
LICENSES Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
llr Simplify menu handling 2025-08-15 12:07:46 +02:00
lookup Replace compiler dependency on css-color-parser crate 2024-07-29 13:13:53 +02:00
parser Add conic gradient support for all backends (#9021) 2025-08-02 09:14:33 +02:00
parser-test-macro A few more format arg inlining 2025-02-07 06:43:19 +01:00
passes Simplify menu handling 2025-08-15 12:07:46 +02:00
tests Binding analysis: We shouldn't report binding loop based on base bindings 2025-07-11 05:16:25 +02:00
widgets live-preview: fixed x for cupertino input fields (#9095) 2025-08-08 01:42:57 +02:00
build.rs Auto-fixed clippy::unnecessary_map_or 2025-02-07 09:02:31 +01:00
builtin_macros.rs Refactoring: get rid in the callable in the Expression tree 2025-01-24 20:26:35 +01:00
builtins.slint core: Add capture_key_event function into items 2025-08-01 20:24:24 +02:00
Cargo.toml Update fdsm dependency to 0.7.0 (#8524) 2025-06-27 08:46:19 +02:00
diagnostics.rs Auto-fixed clippy::unnecessary_map_or 2025-02-07 09:02:31 +01:00
embedded_resources.rs Signed DistanceField font rendering in swrenderer 2024-10-23 09:12:30 +02:00
expression_tree.rs Simplify menu handling 2025-08-15 12:07:46 +02:00
fileaccess.rs Widget style: simplify -light/-dark handling 2024-08-20 16:55:15 +02:00
generator.rs WIP: live-reload for C++ 2025-07-09 09:32:17 +02:00
langtype.rs Fix grammar and typos in comments (in the compiler passes) 2025-08-13 16:27:28 +02:00
layout.rs Fix layout property set in when deriving components 2025-04-23 09:23:07 +02:00
lexer.rs Auto-fixed clippy::needless_lifetimes 2025-02-07 09:20:49 +01:00
lib.rs LSP: Start external process for live preview 2025-07-28 17:13:15 +02:00
literals.rs Use SmolStr in more places of the compiler infrastructure 2024-10-17 18:04:58 +02:00
llr.rs Improve font embedding for MCUs when bundling translations (#7875) 2025-03-18 11:54:28 +01:00
load_builtins.rs Allow to have builtin item function to return a value 2025-03-31 14:06:24 +02:00
lookup.rs Add local variables (#8740) 2025-06-26 15:36:49 +02:00
namedreference.rs Auto-fixed clippy::unnecessary_map_or 2025-02-07 09:02:31 +01:00
object_tree.rs Compiler refactor: Make the Component Node a syntax_nodes::Component 2025-08-01 18:25:40 +02:00
parser.rs Fix typo 2025-08-01 18:25:40 +02:00
passes.rs Fix setting Path.commands from states 2025-08-13 21:00:54 +02:00
pathutils.rs CI: Fix build with nightly and -D warnings 2025-06-06 11:38:50 +02:00
README.md Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
translations.rs CI: Fix remaining lifetime annotation warnings 2025-06-06 11:47:14 +02:00
typeloader.rs Add conic gradient support for all backends (#9021) 2025-08-02 09:14:33 +02:00
typeregister.rs Add stop(), start(), and restart() methods to Timer (#8821) 2025-07-18 14:51:55 +02:00

The Slint Compiler Library

NOTE: This library is an internal crate of the Slint project. This crate should not be used directly by applications using Slint. You should use the slint crate instead.

WARNING: This crate does not follow the semver convention for versioning and can only be used with version = "=x.y.z" in Cargo.toml.