Commit graph

11675 commits

Author SHA1 Message Date
Olivier Goffart
21e67e27a7 LSP: Report error through the LSP when the preview can't open
Instead of panicking the whole server

Issue #204
2024-08-08 12:05:52 +02:00
Olivier Goffart
3c08a71d21 LSP: refactor error reporting of request
So we have accurate error code reported to the LSP when a request fails
2024-08-08 12:05:52 +02:00
Olivier Goffart
6f51c975f5 LSP: don't answer "Empty" for component that do not inherit
... instead of chekcing for "Empty" in the Slint code

Do the suggestion from https://github.com/slint-ui/slint/pull/5625#issuecomment-2228976684
2024-08-08 12:05:29 +02:00
Simon Hausmann
9543a26201 Fix printer demo coming up too small in live-preview
There's an issue that the live-preview doesn't respect the preferred size when actively choosing to preview a new component, but regardless it makes sense to avoid shrinking the printer demo.

Amends ccc795beb8
2024-08-08 11:04:16 +02:00
Update Translations Bot
3d6cea4072 Update Translations: extract strings 2024-08-08 03:04:10 +00:00
Olivier Goffart
c40819b45c Rename the weather-demo library name
The reason why we need to have a `_lib` prefix in the printerdemo and
the too example is because the binary name must be different from the
library name. But in the case of the weather-demo, since there is a
dash, it doesn't need the _lib suffix to be different.

Having a different name than the package name doesn't work with the
`xbuild` tool: fixes #5731
(we use cargo apk for our own build which doesn't have this limitation
anyway)
2024-08-07 16:08:12 +02:00
Nathan Collins
5e49d7f687 Zephyr: move the demo to examples/printerdemo
Given that the Zephyr demo now uses this UI instead of the "_mcu"
version it makes sense to relocate the code too.
2024-08-07 15:26:32 +02:00
Nathan Collins
8feaf7ffe2 Zephyr: make zephyr_process_input_event comments clearer
Prefer "logical coordinate" over "rendered position" which could also
have been interpretted as the screen position.
2024-08-07 15:26:32 +02:00
Nathan Collins
4eb78f7f0b Zephyr: use the non-mcu printerdemo UI
Set the native simulator display size to 1280x720 to match the
hardware.

On the hardware we rotate the screen using the display driver pixel
processing pipeline API. We can tell slint the rotated size via the
window adapter and everything is rendered as expected.

Input still needs rotating, so the software renderer RotationInfo struct and
`transformed` functions are "copied" here. However, we must specify the
opposite orientation in order to get the expected input coordinates.
2024-08-07 15:26:32 +02:00
Nathan Collins
ccc795beb8 Printerdemo window uses preferred width
On full-screen platforms (e.g. the Zephyr demo) it will expand to fill
the screen. Otherwise, the window is the preferred size.
2024-08-07 15:26:32 +02:00
Nathan Collins
5dc74d55a5 Zephyr: enable the PXP for the display driver
The display driver (display_mcux_elcdif) for the test hardware can use
a Pixel Processing Pipeline (PXP) which utilises DMA instead of copying
the framebuffer using `memcpy`. Enabling PXP is the first step to using
it to rotate the display output.
2024-08-07 15:26:32 +02:00
Olivier Goffart
fae774c821 Android: workaround PollEvent::Wake not being recieved
We observe, in issue #5699 that the call to `AndroidAppWaker::wake`
doesn't always result in a `PollEvent::Wake` event.
So to work around that, always process event from any event we recieve
so that any timeout or input event would make sure event gets processed.

Closes #5699
2024-08-07 14:53:50 +02:00
Nigel Breslaw
0fd9bf4b99
UX enhance the Printerdemo primary screen (#5782)
* The general page change animation is more subtle. It's now a combo of fade in and move. As opposed to a full page slide.
* The SVG also has been tweaked to make it symmetrical and remove the lopsided bulge it had.
* The sidebar buttons touch area covers the whole space they represent, as opposed to just being the same size as the icon.
* The code has been simplified a bit. Layout values are moved to DemoPalette and animation values are based on reusable variables to make changing the timings easier.
2024-08-07 14:52:58 +02:00
Olivier Goffart
51adfbdc91 tests: Test that deleting the focussed element in some callback don't panic
More failled attempt at reproducing #5698
2024-08-07 12:50:13 +02:00
Olivier Goffart
f88e5c8ef7 tests: Test deleting the parent for a focus scope from a key event
Attempt at reproducing #5698 although that doesn't panic but the test
is still worth commiting
2024-08-07 12:11:26 +02:00
Olivier Goffart
b6167bd96f vscode: set the tab icon for the embedded preview 2024-08-07 10:01:24 +02:00
Olivier Goffart
c98ba05d95 janitor: vscode: remove useless activation event
Fix warning in json file:

> This activation event can be removed as VS Code generates these automatically from your package.json contribution declarations.
2024-08-07 09:39:07 +02:00
Olivier Goffart
7b4668b481 Vscode extension: add Slint icon to .slint file 2024-08-06 22:53:05 +02:00
Olivier Goffart
0f8246d598
C++: add assert_main_thread to public functions in the Window
Some have it some don't. Just add it everywhere.

See https://github.com/slint-ui/slint/discussions/5762
2024-08-06 22:52:45 +02:00
Olivier Goffart
916d6cd186 brighter/darker: Add docs that specify that we go in the HSV color space
Just copy the sentences from the rust docs for slint::Color

Closes #5753
2024-08-06 16:43:45 +02:00
Simon Hausmann
d6b3e69a7e Fix SLINT_DEBUG_PERFORMANCE="overlay" with Skia
After the FontMgr changes in the previous Skia update we can't default
construct Font anymore. Let's use the same default font we also use for
regular text then.

Fixes #5764
2024-08-06 16:12:15 +02:00
Olivier Goffart
046b64afec Revert "ESP32: Fix flashing examples such as printerdemo_mcu with espflash"
This reverts commit 2c06ed697b.

This doesn't work for me, the application crashes at start.
Also the espflash tool edits the file to add the device in it which
causes dirty files in git.

Instead, document to use CARGO_PROFILE_RELEASE_OPT_LEVEL=s in the readme
2024-08-06 14:27:23 +02:00
Simon Hausmann
cadfd9e104 Testing: Fix querying for elements by id when using _
The compiler normalizes `the_element` to `the-element`, so we also need to normalize that behind our API.
2024-08-05 10:32:21 +02:00
Update Translations Bot
531da6ac51 Update Translations: extract strings 2024-08-03 03:03:57 +00:00
Simon Hausmann
336f75181d Mark SampleComponent in rust docs as !Send and !Sync
The actual generated components aren't Send/Sync either.

Fixes #5742
2024-08-02 09:31:20 +02:00
Olivier Goffart
195a54359c fix docs compilation when the renderer-software feature is disabled
Fixes #5743
2024-08-02 09:25:16 +02:00
Simon Hausmann
b1dab29366 Fix Node.js example instructions 2024-08-01 13:37:20 +02:00
W Etheredge
80ae11cd80 Use associated constants on number types 2024-08-01 07:53:48 +02:00
Nathan Collins
045cd0c154 Zephyr: active animations only cause a sleep on the native simulator
The Zephyr POSIX architecture used by the native simulator is unable
to interrupt a busy thread [1]. Therefore we must sleep even when
there are active animations to allow other threads to progress,
otherwise we end up in an infinite loop. This limitation does not
apply to real hardware, where we can simply continue the event loop.

[1] https://docs.zephyrproject.org/3.7.0/boards/native/doc/arch_soc.html#important-limitations
2024-07-31 16:38:55 +02:00
Simon Hausmann
789fc74f07 doc: hide internal RenderingNotifier trait
We implemented it for the required public FnMut signature.
2024-07-31 10:44:15 +02:00
FloVanGH
9b7397f9ac
Fixed text input on 24hour time picker (#5723) 2024-07-31 07:00:37 +00:00
Kevin Moonen
34f1a990d7 Clarify that generated <kind>_clicked callbacks are aliases
My assumption from reading the docs was that the `StandardButton`s
delegated to the root and that the generated callbacks in the root
were to facilitate that behavior.
2024-07-31 07:25:41 +02:00
botent
17f71a3b15 Typos-Fix: Getting Started Docs 2024-07-30 21:52:37 +02:00
Simon Hausmann
4afc3a2e84 Disable builds with nightly Rust temporarily
cc #5722
2024-07-30 13:46:04 +02:00
Simon Hausmann
d3aa425682 Fix build with [ "backend-linuxkms-noseat", "renderer-skia-opengl", "gettext", "compat-1-2" ], default-features = false }
Test for `renderer-skia-opengl` as `renderer-skia` enables the former.
2024-07-30 13:39:25 +02:00
Simon Hausmann
9bef3e47f4 Fix GBM rendering on mali EGL drivers
Combining an EGL config with EGL_ALPHA_SIZE == 8 with an Xrgb8888 surface yields a bad match on eglCreateWindowSurface.
That's fair, and we should accomodate for that by avoiding such EGL configs.
2024-07-30 13:04:48 +02:00
Simon Hausmann
8a7db55bb6
Route debug() calls in Slint consistently through Platform's debug_log() (#5718) 2024-07-29 16:31:09 +02:00
Simon Hausmann
d8e7226cd5 Add also slint-viewer arm binaries to the GitHub release 2024-07-29 13:47:27 +02:00
Simon Hausmann
a5380a8bb3 Fix arm lsp artifact names 2024-07-29 13:47:27 +02:00
Simon Hausmann
41d7f76425 Add support for building armv7 and aarch64 viewer/lsp binaries
Fixes #5707
2024-07-29 13:47:27 +02:00
Justyna Hudziak
ed00552b3f Weather-demo: unify directory and package names
Rename every possible entity from rusty-weather to
weather-demo to avoid confusions.
2024-07-29 13:39:20 +02:00
Justyna Hudziak
58a483a613 Weather-demo: fix crashing apk from nightly builds
Add "lib" as a target crate-type beside "cdylib".

Remove platform settings from the Cargo.toml file
to match with other examples.
2024-07-29 13:39:20 +02:00
Simon Hausmann
b5c61fb2f5 Skia: Make sure to consistently apply the global alpha
Replace uses of skia_safe::Paint::default() with calls to self.default_paint(), to apply the current global alpha.

Fixes #5706
2024-07-29 13:21:21 +02:00
Simon Hausmann
6d7cc521fc Replace compiler dependency on css-color-parser crate
The crate uses an old version of lazy_static that doesn't seem to reliably compiler with newer versions of Rust.

This is a partial fix for #5702 as all the compiler needs is the named color table.
2024-07-29 13:13:53 +02:00
Simon Hausmann
e0f3fd4168 Fix path to weather demo apk 2024-07-26 14:56:11 +02:00
Simon Hausmann
69759e5ba4 Fix the actual rust-weather apk build invocation 2024-07-26 14:03:32 +02:00
Simon Hausmann
643809164b Prospective fix for Android apk build 2024-07-26 13:46:35 +02:00
Justyna Hudziak
d399900f20 Weather-demo: include demo in the apk building job 2024-07-26 13:34:30 +02:00
Justyna Hudziak
4f384f8787 Weather-demo: add open_weather feature
Introduce a new open_weather feature to avoid
unnecessary compilation of OpenSSL for Android
when using dummy data.
2024-07-26 13:34:30 +02:00
Justyna Hudziak
5b5ca1ce5f Weather-demo: remove workaround to hide cursor
Remove no longer necessary workaround for #5233.
2024-07-26 13:34:30 +02:00