Commit graph

1676 commits

Author SHA1 Message Date
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
Justyna Hudziak
67b8515267 Weather-demo: fix no persistent data on desktop
Ensure directories for saving persistent data are
available. Otherwise data are never saved.
2024-07-26 13:34:30 +02:00
Update Translations Bot
9c30cdaf3b Update Translations: extract strings 2024-07-25 03:06:11 +00:00
ogoffart
aa25e3cd44 Bump version number to 1.7.1 2024-07-23 12:05:34 +00:00
Simon Hausmann
5cf30431e7 weather-demo: move index.html into the directory where the CI expects it 2024-07-22 14:57:53 +02:00
Justyna Hudziak
33c84b67b4 weather-demo: initial commit 2024-07-22 13:34:35 +02:00
Update Translations Bot
8714facc7e Update Translations: extract strings 2024-07-18 03:05:29 +00:00
Simon Hausmann
f91670dcfd Fix date/time picker type names in the gallery 2024-07-17 14:04:31 +02:00
Simon Hausmann
52f8249189 testing: Minor rename after a quick round of API review
- ElementHandle::match_descendants() becomes ElementHandle::query_descendants() to emphasize that this creates a query.
- Added ElementQuery::from_root() to remove the need to use the ElementRoot trait.
2024-07-15 11:30:34 +02:00
Simon Hausmann
c90abe0539 Switch Rust Todo app unit testing to use the new API to lcoate the line edit. 2024-07-15 11:30:34 +02:00
Rafael Bachmann
19116252f4 Fix cheating in memory game
one could cheat :) by simply clicking again on an opened tile, closing it again.
2024-07-15 09:34:26 +02:00
Simon Hausmann
4c73006bf9 Remove stray imports of StyleMetrics
These are not needed AFAICS.
2024-07-12 09:13:35 +02:00
Simon Hausmann
e3aab79fdb Python: Improve Struct mapping
When reading, create the local equivalent of a dataclass, so that access
doesn't require ["foo"] key syntax.

Also implement the copy protocol, so that we can safely make clones of
the references returned by the ListModel.
2024-07-11 22:08:10 +02:00
Update Translations Bot
4de9cae583 Update Translations: extract strings 2024-07-11 03:05:01 +00:00
Simon Hausmann
c81ab5cd6d Remove hard-coded sizes from date and time picker popups
Use the layout and position the popup centered relative to its parent.
2024-07-10 13:43:41 +02:00
Tobias Hunger
05e0b4dc68 live-preview: Have a simple mode for bools and strings
The property editor built into the live-preview now comes with the
concept of a "simple/complex mode". There is a "K" (for complex, obviously;-)
or a "S" (for simple, just as obvious) beween the property name and property
value. you can click on the letter to switch from simple to complex mode,
but you can only switch back to simple mode if there are no complex expressions
in the line edit.

This implements a "simple" mode for bools.

# Todo

 * [ ] Find icons for simple/complex mode:-)
 * [ ] Figure out how to decide whether other types are "simple"
 * [ ] Define more UIs for simple types

live-preview: Move simple property code into rust

... and handle simple strings in addition to bool.
2024-07-10 11:47:06 +02:00
Olivier Goffart
42d7661ec6 C++: make the PhysicalRegion::rectangles non-overlapping 2024-07-10 10:58:27 +02:00
Florian Blasius
6e2013e4ff
API Review: DatePicker and TimePicker (#5582) 2024-07-09 22:16:54 +02:00
Simon Hausmann
7734430cd5 Fix esp-idf carousel build 2024-07-09 08:56:45 +02:00
Simon Hausmann
6750a454c1 Rename touch and panel to touch_handle and panel_handle and document their nullptr values 2024-07-08 21:36:47 +02:00
Nathan Collins
3d5a876f1e Zephyr: update Zephyr SDK version in README.md
Direct the reader to the same version that the CI uses.
2024-07-08 16:46:33 +02:00
Nathan Collins
b23e846e84 Zephyr: update the README.md with known issues
Include the current know issues in the documentation, so that they
aren't hidden in a pull request.
2024-07-08 16:46:33 +02:00
Nathan Collins
538387b3d6 Zephyr: apply license headers
The Zephyr VERSION file is excluded as this simply specifies the version
of the Zephyr applicaiton, and the documentation doesn't say how
comments should be specified or if they are supported.
2024-07-08 16:46:33 +02:00
Nathan Collins
2ce3e70094 Zephyr: allow the event loop to wait forever
If there are no active animations or timer updates, allow the event
loop to run forever, rather than hardcoding five seconds.
2024-07-08 16:46:33 +02:00
Nathan Collins
9fc7477014 Zephyr: individually render the dirty sub-regions
The software renderer now provides a list of regions which have
changed.  Convert the regions to big-endian and render them
individually to prevent the non-dirty regions from being converted
away from big-endian.  Unfortunately, this still means we convert any
intersection between region more than once but this will be tackled as
a follow-up commit, as in principle this affects more than just the
Zephyr demo.
2024-07-08 16:46:33 +02:00
Nathan Collins
93bca206aa Zephyr: prefer a release build for hardware
The performance is much better, so for someone testing the demo based
on the readme, this gives a better first experience.
2024-07-08 16:46:33 +02:00
Nathan Collins
4841e9acfc Zephyr: fix use of deprecated board specification
The hardware model in Zephyr has changed. Use the way to specify a
board.
2024-07-08 16:46:33 +02:00
Nathan Collins
57e327f3e6 Use working Zephyr revision
The native simulator uses the SDL display driver. In Zephyr v3.6.0 this
driver incorrectly mixes pitch and width in asserts, causing the
application to assert when run. This revision fixes the assert. Ideally
we would use a tagged release, but there is not one available yet.
2024-07-08 16:46:33 +02:00
Nathan Collins
d448170219 Add a West manifest
Track the Zephyr v3.6.0 release. Update the documentation to make use
of the West manifest.
2024-07-08 16:46:33 +02:00
Nathan Collins
68a02013e4 Zephyr: document why PIXEL_FORMAT_BGR_565 works
Zephyr expects pixel data to be big endian [1].

The display driver expects RGB 565 pixel data [2], and appears to expect
it to be little endian.

By passing Slint's little endian, RGB 565 pixel data without converting
to big endian as Zephyr expects, we get colors that work.

[1] https://docs.zephyrproject.org/latest/hardware/peripherals/display/index.html#c.display_pixel_format
[2] c211cb347e/drivers/display/display_mcux_elcdif.c (L256)
2024-07-08 16:46:33 +02:00
Nathan Collins
caf75ce84c Zephyr: prefer a release build on device
Render times are greatly improved in release builds.
2024-07-08 16:46:33 +02:00
Nathan Collins
4732a0b759 Zephyr: log render times
Slint is taking quite some time to update the render buffer:

```
// Initial render
[00:00:01.727,000] <dbg> zephyrSlint: maybe_redraw: Rendered x: 0 y: 0 w: 720 h: 1280
[00:00:01.727,000] <dbg> zephyrSlint: maybe_redraw:  - total: 1363 ms, slint: 1347 ms, write: 16 ms
[00:00:01.727,000] <dbg> zephyrSlint: run_event_loop: Sleeping for 0ms
[00:00:01.727,000] <dbg> zephyrSlint: run_event_loop: Loop

// Partial update
[00:00:02.255,000] <dbg> zephyrSlint: maybe_redraw: Rendered x: 146 y: 18 w: 156 h: 204
[00:00:02.255,000] <dbg> zephyrSlint: maybe_redraw:  - total: 525 ms, slint: 504 ms, write: 21 ms
[00:00:02.255,000] <dbg> zephyrSlint: run_event_loop: Sleeping for 474ms
```
2024-07-08 16:46:33 +02:00
Nathan Collins
038d7f8381 Zephyr: Rendering on device works if we don't change to big endian
Zephyr reports that the RK055HDMIPI4MA0 MIPI display is using
PIXEL_FORMAT_BGR_565.

The buffer we provide to Slint uses `slint::platform::Rgb565Pixel`.

Somewhere, the pixel data ends up in the correct format to display on
the test hardware.
2024-07-08 16:46:33 +02:00
Nathan Collins
3c4a019d75 Zephyr: fix format specifier warning
Use the correct format for the duration representation.
2024-07-08 16:46:33 +02:00
Nathan Collins
cb5b78b45a Build and run on NXP MIMXRT1170-EVKB
Setup the printerdemo_mcu example to build and run on the NXP
MIMXRT1170-EVKB.

There is an issue with the supported pixel formats, which will be
resolved in a future commit
2024-07-08 16:46:33 +02:00
Nathan Collins
71987d8fb3 Zephyr: don't use std::mutex
Zephyr does not support std::mutex [1].

[1] https://docs.zephyrproject.org/latest/develop/languages/cpp/index.html#language-features
2024-07-08 16:46:33 +02:00
Nathan Collins
fe711aad10 Zephyr: don't block main thread with animations
Make sure we sleep, even if there are animations. Previously we would
spin the event loop forever once an animation started.

Ideally we need some slint API to get the duration until the next
animation tick.
2024-07-08 16:46:33 +02:00
Nathan Collins
43ea064207 Zephyr: handle touch events
Define a simple callback to handle touch events from Zephyr. We expect
an input_sdl_touch device to exist in the device tree. This is a fairly
simple implementation as a proof of concept.

The default behaviour of Zephyr (as configured) is to handle inputs in a
separate thread. Each `input_event` describes a specific change, with the
`sync` member specifying when the event has reached a stable state. We
use slint::invoke_from_event_loop to dispatch the slint event in the
main thread.
2024-07-08 16:46:33 +02:00
Nathan Collins
c32b941f62 Zephyr: Turn off display blanking once
This stops the display from flickering in the native_sim.
2024-07-08 16:46:33 +02:00
Nathan Collins
3a12cfbdfc Enable asserts in Zephyr
Turn on Zephyr asserts to help root out issues with the Zephyr
platform code.
2024-07-08 16:46:33 +02:00
Nathan Collins
4a2c4ab89c Fix ZephyrWindowAdapter rendering
Use the correct offset into the buffer. In combination with
zephyrproject-rtos/zephyr#72007 partial rendering now works as
expected.
2024-07-08 16:46:33 +02:00
Nathan Collins
8a4a3c22c2 Update examples/printerdemo_mcu/zephyr/README.md
Don't forget to source the Zephyr virtual env.
2024-07-08 16:46:33 +02:00
Nathan Collins
cc39d0a016 Render printerdemo in Zephyr RTOS
Add a variant of the printerdemo_mcu that works with Zephyr. For now
we only target the native_sim, and only have rendering set up. Future
commits will add touch support, and investigate synchronization
issues.
2024-07-08 16:46:33 +02:00
Olivier Goffart
a0dd978f8a Deprecate exporting the last import if there is no other exported component 2024-07-03 13:34:08 +02:00
Olivier Goffart
66370b6bda
Add export { ... } from "....slint"; syntax. (#5533) 2024-07-03 12:50:40 +02:00
Olivier Goffart
e9e987a736 Fix warnings: there is no "std" feature in that crate 2024-07-02 13:34:11 +02:00
Arnold Loubriat
ce2db77e88
Add the accessible-placeholder-text property (#5464) 2024-06-26 12:59:22 +02:00
Olivier Goffart
acb7da11d2 fix missing warning of missing export
... for last component when globals are exported
2024-06-21 11:57:49 +02:00
Update Translations Bot
ddc15c0813 Update Translations: extract strings 2024-06-19 03:04:16 +00:00