This is the counter-part, which removes focus from the element if it's currently focused. The window - if focused - may still be focused towards the windowing system.
Updated the version from 1.1 to 1.2
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
Use a `$` sing in the name of special property so that they do not
replace user defined properties
The scale_factor property was unused since 9fd7d35b0d or even before
Fixes#4961
We were having a reference to the parent item tree, assuming the parent
was living longer than the item tree. But this is not the case if
there existed a ItemRc to one item in the inner part.
So use a Weak for the parent instead.
What happens is that the item is destroyed and removed from the layout
when clicking. But the send exit event still query the geometry if the
ItemRc which points to position in the layout cache that is not valid.
The Rust and C++ generator already check for the vailidity of the index
and return 0 if it's too large.
Fixes#3589
The main change is that the window adapter is not copied into
sub-components anymore - instead it is accessed through the root. This
is especially important for globals.
In order to add the root, a little extra dance had to be performance on
instantiation: The self_rc/self_weak is created first and the
ComponentExtraData's fields are populated via once_cells.
Consume the Rc in the function signature where the implementation would clone it anyway.
This is also needed in preparation for InstanceRef::window_adapter()
walking up the tree of components,
by which it's not possible to return a reference anymore as
parent_instance() returns a new lifetime that's shorter than &self
inside window_adapter().
Replace all call sites that call unwrap() on window_adapter_ref() with a call
that returns a &Rc<dyn WindowAdapter> and use an Option variant for register/unregister component.
For the former, in the future, we want to create the adapter if it doesn't exist.
For the latter we don't want to do that.
Replace `fn window_ref(component) -> Option<& WindowInner)` with
`component.access_window(cb: impl FnOnce(&WindowInner))` as
all call sites unconditionally called unwrap() on them and by using the
pattern with a closure, we can in the future get the WindowInner from an
Rc<dyn Adapter> instead of an &Rc<dyn WindowAdapter>.
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.
The added functions enable mixing colors and manipulating the opacity
of colors and brushes.
They enable the behavior of some of the available functions from SASS and are
added for future use for adding the Adwaita style (future PR).
In the compiler this is still very primitive, but an attempt to start a
generic interface. The basic assumption is that all item functions will
eventually need access to the window adapter and itemrc. Support for
additional arguments is still missing.
Also missing is support for the function access via rtti in the
interpreter, hence the hardcoding at the moment.
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