Tidy up the main examples/README.md.
All the main examples now live in a table with a thumbnail and description.
Then each project has it's own README.md with more details.
Following the winit 0.29 merge, a few adjustments are in order:
- Make slint::Window.set_size() before show keep the size
- on wasm, attempt to keep the size of the canvas from CSS
- on wasm, one must set the width and height explicitly on the canvas
otherwise there is wierd scaling
- on wasm, we can't set None as maximum or minimum size otherwise winit
panics
- It seems that the hack we had to keep the size in range is no longer
necessary
- The hack in the slide puzzle can be removed. (but unfortunately it
doesn't follow resizes
Unfortunatelly we always call set_inner_size to avoid infinite loop when
the css properties are not specificed, so this will override layouts
Also we don't default anymore to the preferred size
* Update internal/backends/winit/winitwindowadapter.rs
Since winit can't handle resize from the CSS or JS, work it around in
the demo by calling set_size on the slint window.
Also fix slint_size panicking not working on wasm as the map_state was
mutably borrowed by the set_size, and this may recurse into other
functions (eg, draw) causing a panic. So don't keep the state borrowed
when calling winit.
Another fix is fixing the initialization size of the window item when
the initial size is set with set_size
Fixes#547
With commit b55ec6894a the preferred size
of the background image of the slide puzzle demo propagates to the
Window, which causes the web build of the winit backend to use the
window's preferred size instead of the 100% viewport width/height set
via CSS.
Work around it via manual positioning.