Add flags that enable the Button to be used as a Toggle, e.g. for use in toolbars or similar places.
Co-authored-by: Simon Hausmann <hausmann@gmail.com>
I want to track component structure changes in the window without
generating more code. So use a more generic name for the init_*_items
functions, so that I can add the functionality I need in there.
Also add a register_component to PlatformWindow and call that.
I want a more generic name as I want to do to track component structure
changes in addition to resource freeing and I do not want to add another
call into the generated code.
state info properties are special and cannot simply be inlined or set
(because we need to record the time it was changed and stuff)
So disable the optimization for now.
In fact, what could be done is to remove the state entirely if the state property
is constant. But that change is a bit more involved
This patch does:
- Don't inline const state property
- Don't generate a call to .set in the generated code
- Also allowed to debug the expression with a context from the generator
(added T generic parameter to the pretty printer)
Fix panic reported in https://github.com/slint-ui/slint/issues/1327#issuecomment-1151244049
Implement some very rudimentary font fallback handling and add some the
glyphs the puzzle needs.
The font fallback handling deserves to go into a module shared between
GL backend and the compiler.
For the character selection we should scan the text elements for
literals just like we do for the font size.
Make sure to embed whatever we pick as default font, but also register
any custom imported fonts.
This fixes the plaster font not showing up in the slide puzzle on the
stm32.
Implement basic accessibility (a11y) support, using the Qt backend.
_This should get us started, but accessibility support is an additional way to interact with UIs that is very different from the "graphical way" most users will interact with the UI. No single PR will "make a toolkit accessibility", this needs to be an ongoing effort!_
Parts of this PR:
* Add functions to access a11y-related properties to Component
* Add helper functions to Item struct
* Handle accessible- properties in the compiler
* Add documentation, add description, enforce some basic rules
* Make the Text element accessible by default
* Don't optimize away accessibility property in the LLR
* Ensure that accessibility property are marked as used
* Add some accessibility properties to the native style widgets
* Support for bool and integer `accessible` properties
* Implement basic support for accessibility
* Make basic widgets accessible by default
* Make slider focus-able and interactable with keyboard
* Tell a11y layer about value changes
* Generate QAccessible constants using bindgen
* Don't expose the `accessible` properties when using the MCU backend: There is no backend to make use of them
* Handle focus change based on keyboard focus of the window
* Report accessible widgets at correct positions
* Allow for (virtual) focus delegation at the a11y level
* Calculate value step size dynamically
* Make sure to not send notifications to a11y backend about dead objects
The generated code provides a PinnedDrop implementation that calls
free_component_item_graphics_resources. We must annotate the components
correctly to make sure to the drop implementation is called and graphics
resources are released.
Thanks to Jocelyn!
Fixes#1261
We can't use file system call to load files with wasm, we need to go through the vscode API
Note that this is all async, so i had to prevent re-entry within the compiler using a rentry trick.
I removed the lifetime in the TypeLoader because I thought this was going to be necessary
to get 'static futures. But it turned out not to be necessary. Anyway, I kept it htis way because
it is actually nicer IMHO, even if the CompilationConfiguration is now copied
When the percentage is missing, we should interpolate between the
last valid entry to the first valid entry after that, not always the
last valid entry in the whole gradient
We changed the MSRV in the last release because some dependency depended on
Rust 1.59. But that did not concern the C++ build, for example.
Now that we rely on rust 1.59 in our own code, we should make it explicit
so that the compilation error show the proper error
The `lower_property_to_element` pass usually disallows that because it
injects the Layer element and we can't do that for components. But we
can handle this like with opacity and inline.
Normally, child of layout don't get optimized anyway because
the layout sets their `x` and `y` prop, preventing the optimization.
But if the rectangle has an opacity, its `x` and `y` property are
stolen by the opacity element, and then it can get optimized anyway
Fixes#1267
Enable fontdb's fontconfig feature to parse fontconfig files to locate
the directories where truetype fonts are located. This helps in system
setups that differ from the defaults that fontdb uses otherwise.
Fixes#1240
This breaks the printer demo USB page, it makes it impossible to
change the current item.
That's because the printer demo do `current-item: 1;` to preselect the cat.
But that breaks the property binding that makes current-item follow the
actual-current-item.
* Revert "move actual-current-item to FocusScope"
This reverts commit 8240531e6e.
* Revert "reset StandardListView's current-item if it is out of bounds"
This reverts commit 9d18882f9d.
* janitor: Fix clippy error in textlayout.rs
This one is almost certainly a bug.
* janitor: clippy fixes in inline_expressions.rs
Clippy claims the original code was slower and less clean, so let's
change this.