Changing the constraint doesn't work on non-rezsizable window.
So first set the window as resizeable, then change the constraints, then
maybe remove the resizable flag
The situation differs depending if the widget show the virtual keyboard or not:
For widget that don't show the virtual keyboard, we rely on the winit events,
but for some reason we don't recieve WindowEvent::ModifiersChanged events with
wasm. Since the event handling in winit is about to be rewriten, I did not
bother reporting the bug upstream, but just work around by using the deprecated
API. So that way shift + tab will no longer be understood as just tab.
For widget using the virtual keyboard, then the event handling is in
wasm_input_helper.rs. There is a couple of issues:
- We must map shift+tab to backtab.
- We need to prevent the default events to trigger, so that tab and other
shortcuts don't take effect on the browser. Winit already inhibit these
events so we must do the same otherwise tab and shift+tab would change the
html focus.
- By luck, tab used to give the focus back to the canvas before (see previous
point) and that's why it worked. But now that we don't do that anymore,
hiding the virtual keyboard should actually re-focus the canvas
- That will cause the focus event to be intercepted by winit, and will cause
recursions and borrow error, so we make sure that we do not recurse when
getting the focus event
Commit c85e1b6d25 added a workaround for a
winit issue, which has been fixed upstream. Until a new release is
available, let's patch in winit from a branch that has the fix
cherry-picked.
This way we don't have to remember to remove the workaround with the
next update and this has been verified on the device.
If the global opacity is zero, we don't need to paint rectangles, etc.
This shortcut is a compromise between opting out much later on femtovg
level and too early before querying properties of the rectangle. We
still want to do the latter as somebody might depend on that.
IDWriteFontFallback::MapCharacters only returns one single font that tries to cover
as much of the input string as possible. We need to continue processing the remaining parts of the text,
in order to get a complete list for all fonts we need.
Fixes#1139
cbindgen 0.21 was released which contains https://github.com/eqrion/cbindgen/pull/724
which allow to use raw identifier in enums shared with C++.
So now we can have `MouseCursor.move` in slint despite it being a rust keyword
Note that the strum macro also have trouble with the raw identifier, so we
take that in account in the conversion functions in the interpreter
I only tested on X11 plasma, and there this doesn't have any effect,
But this might be needed because i removed it a few commit ago in another
function.
I think the reason it is there is that it allow changing from a fixed size
to a custom size
When blitting a rectangular texture, we can disable the anti-aliasing on the edges
that femtovg applies by default. That avoids an extra triangle strip for
this stroke to apply anti-aliasing.
When a second canvas is visible, only animations in the first canvas
resulted in updates and visible animation. An animation in the second
canvas wouldn't result in repaints.
When we start an animation, we request a redraw on all windows and
return with `ControlFlow::Poll` to winit.
Winit then schedules an animation frame request, and in the callback the
redraw request events are delivered. For the first window we call
`update_animations()`, a new tick is detected (different than the
previous one) and animated properties are dirty and yield new windows.
Then right away we get called again with a redraw request for the second
window. update_animations() determines that the instant::now() is the
same, and has_animations() returns false. So at the end of the event
handler we return fail to return `Poll` and therefore no animation frame
request is created, which means the animations just stop.
Fix this by calling update_animations() only once, when all input events
have been processed and the redraw events are up for delivery next.
This is visible in the preview canvases in the documentation, if a
canvas other than the first has animations.
cc #215
Handle Input event from the input directly instead of going through winit
for the TextInput.
Note that this doesn't handle the composition event well, so the text is
only considered written when it is accepted
This also separates the blend-to-screen part of render_layer into a
helper function, as that will be useful in the future with public layer
elements.
Relates to #725
Delegate the decision how to implement the Clip element entirely into the backend,
where the GL backend can now explicitly render
children into a layer, instead of the hack with a layer in the renderer's
state and the extra save/restore pair.