Note, this goes against the gettext documentation's recommendation:
https://www.gnu.org/software/gettext/manual/gettext.html#Contexts
> Finding a canonical msgctxt string that doesn’t change over time can be hard.
> But you shouldn’t use the file name or class name containing the pgettext
> call – because it is a common development task to rename a file or a class,
> and it shouldn’t cause translator work.
This patch adds a `close()` function that can be called to close a popup
window, and a `close-to-click` boolean that can be set to false to
disable the default behavior.
In the screenshot tests this works by setting SLINT_DEFAULT_FONT to
pointer to a directory, instead of a file. We then load all fonts in
that directory and consider their families the default unless a family
is specified. This way for "Noto Sans" a regular as well as an italic
version is registered in fontdb and returned in the list of font
fallback ids. embed_glyphs in the compiler then embeds those variants
and we find them at run-time.
For .slint files that are included, we canonicalize the path before
adding it into the import stack, to avoid duplicates. We didn't do that
for images in the global_embedded_resources.
Ensure this by canonicalizing as early as possible.
Fixes#2608
The previous code was only re-creating the layout properties for these
that had a binding, but that wasn't done if the property was just read,
leading to access to non-existing properties later.
Fixes#2483
This patch merges the changes from #2344 and #2491 and do some cleanup
In particular, this visit the init code expression when visiting the
root element expression
Closes#2344Closes#2491Fixes#2487
If one declare a `property <int> foo;` in Slint, it will be private by
default, and the getter/setter won't be generated, and it may be
confusing as to why
With this change, it still generate private getter and setter so this
gives a better hint to the developer what the problem is.
Replaces #2170
An element with children must be fully inlined or the children array
can't be easily computed.
But the code wouldn't work if the base of a component was not inlined
Just like opacity and other properties, it needs to prevent inlining.
And also add the same warning as for opacity if it is used on the root
(the Window)
As outlined in #2199, there may be ways to trigger text layout code
through forward-focus before embedded fonts are registered. To fix this,
this patch replaces the init_code vector, which had the SetFocusItem
code before the font registration, with three explicit vectors for focus
setup code, code from init callbacks, and initial focus, and defines the
order in one central place in the copmiler (iter()).
Fixes#2199