Commit graph

11738 commits

Author SHA1 Message Date
Olivier Goffart
a9f526491a Timer Element
Closes #5724
2024-08-16 16:36:38 +02:00
Olivier Goffart
2643a327e8 Change events: keep unused property with change event 2024-08-16 16:36:38 +02:00
Olivier Goffart
3a12ebf7ab Report an error when accessing a function within a PopupWindow
instead of panicking

Fixes #5852
2024-08-16 10:31:13 +02:00
Olivier Goffart
8a0df2b3a5 Rename NumValueExpression -> NumberWithUnitExpression 2024-08-15 14:52:13 +02:00
Olivier Goffart
9b71cf1a36 Math postfix member functions on numbers
Closes #5328
2024-08-15 14:52:13 +02:00
ogoffart
4dd7d96a28 Bump version number to 1.8.0 2024-08-15 12:44:46 +00:00
Tobias Hunger
0b99a3d023 live-preview: Use preferred size when requesting preview
Force the preview to preferred size when explicitly asking to
preview something.
2024-08-15 13:47:25 +02:00
Simon Hausmann
641b833c91 Fix TextEdit not invoking edited callbacks
Fixes #5848
2024-08-15 10:10:08 +02:00
Tobias Hunger
092ca597bb live-preview: Remove history navigation
We apparently do not want history-based navigation,
so remove the code supporting that again.
2024-08-14 16:05:24 +02:00
Tobias Hunger
e01da55c22 winit: Suppress warnings when building for WASM
I am not happy with the `allow(unused)`, but putting
`cfg(not(target_family = "wasm"))` was getting out of
hand.
2024-08-14 15:55:49 +02:00
Tobias Hunger
58e85ef317 winit: Suppress warning about web_sys_unstable_api cfg
This is supposed to be set via `RUST_FLAGS` by users of our crate,
so allow it in `cfg`.
2024-08-14 15:55:49 +02:00
Simon Hausmann
18d6d2da29 Add Rust API for build.rs to specify the scale factor ahead of time 2024-08-14 11:00:50 +02:00
Simon Hausmann
a727d87796 CMake: Make it possible to override the scale factor
Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
2024-08-14 11:00:50 +02:00
Simon Hausmann
fb6775b386 When the slint scale factor is provided at compile time, propagate it also as initial value to the slint::Window created 2024-08-14 11:00:50 +02:00
Simon Hausmann
360f192b91 esp-idf: Adjust touch coordinates to scale factor
Taken from https://github.com/slint-ui/slint/pull/5016/files

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2024-08-14 11:00:50 +02:00
Tobias Hunger
4a3a86a0b0 interpreter: Remove internal API from deprecated ComponentCompiler
It is not used anymore and internal, so let's remove it.
2024-08-14 10:49:37 +02:00
Tobias Hunger
013c687296 lsp: Replace common::UrlVersion with SourceFileVersion
The compiler defines `SourceFileVersion`, let's use that consistently.
2024-08-14 10:49:37 +02:00
Olivier Goffart
ff0f2f0d6b Revert "Prepare the v1.7.2 release"
This reverts commit 3f8163fa3f.

Release is done
2024-08-14 10:33:58 +02:00
Olivier Goffart
014741c72b Changelog: Add 1.7.2 date and link 2024-08-14 10:27:58 +02:00
Olivier Goffart
3f8163fa3f Prepare the v1.7.2 release 2024-08-14 09:38:27 +02:00
Olivier Goffart
a3eb2eedb4 More changelog entries 2024-08-14 09:26:18 +02:00
Tobias Hunger
3b17f19be0 core: Do not panic when popups try to find their parent
Popups may have normal `Item`s as parrent, while all the other
components always have a `DynamicTree` as a parent. So do not
panic when some component ends up with an `Item` as a parent.

Just return `None` instead of panicing.

We probably need to make the focus-handling more aware of
popups eventually, but this stops the panics.

Fixes: #5826, #5830
2024-08-14 09:08:31 +02:00
Olivier Goffart
08009199b9 mcu-board-support: Update dependencies 2024-08-13 23:39:13 +02:00
Simon Hausmann
834a29f25e Share the font cache across compiler invocations in the screenshots explicitly
... instead of implicitly through thread-local storage.
2024-08-13 16:08:24 +02:00
Simon Hausmann
f55cbc5549 Speed up screenshot test driver build
The test's build.rs invokes the compiler repeatedly with a configuration that enables font embedding. Instead of loading the same font with fontdue repeatedly (slow), store the loaded fonts in a hash table for re-use.

This should not have any impact on single file compilations, but it helps with the screenshot driver test dramatically, bringing down the time of

       touch tests/screenshots/build.rs
       cargo build -p test-driver-screenshots

    on my xps13 linux from 1m26s to 15s.
2024-08-13 16:08:24 +02:00
Simon Hausmann
ad6e12dacf Speed up glyph embedding in the compiler
Enable the use of parallel glyph outline extraction in fontdue.

Brings down the time of

   touch tests/screenshots/build.rs
   cargo build -p test-driver-screenshots

on my xps13 linux from 3m30s to 1m26s.
2024-08-13 16:08:24 +02:00
Simon Hausmann
782bf6e7c6 Minor tweak to the quickstart guide
Apply #5618 also to the quickstart guide.
2024-08-13 15:02:43 +02:00
Simon Hausmann
227bd78150 Change Rust Quickstart to use the Rust template
This reduces duplicated documentation and fixes two bugs. One minor additional change is that Rust code from the game logic chapter can now safely be copied, because the tiles variable is cloned in the previous step.

Fixes #5825
Fixes #5824
2024-08-13 15:02:43 +02:00
Simon Hausmann
636de6fc7c Python: Fix support for named exports 2024-08-13 12:04:04 +02:00
Simon Hausmann
2d5d53fba8 Fix comment about "internal"-ness of internal feature gated interpreter function
Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2024-08-13 12:04:04 +02:00
Simon Hausmann
28f9d3cc71 Remove unnecessary helper function 2024-08-13 12:04:04 +02:00
Simon Hausmann
5e39e211c2 Fix build without internal feature 2024-08-13 12:04:04 +02:00
Simon Hausmann
1e3f05c983 Python: Expose Slint structs
Structs declared and exported in Slint are now available in the module namespace
with a constructor.

Fixes #5708
2024-08-13 12:04:04 +02:00
Nigel Breslaw
048c0eaf08
Update example readmes
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.
2024-08-13 11:35:39 +02:00
Olivier Goffart
6f939b6c0a Prospective fix for nightly build failure 2024-08-13 08:40:23 +02:00
Olivier Goffart
8db0403469 vscode extension: Make the error message in case of crash a single line
Better to limit the lines in the log to make it easier to locate the
real error
2024-08-12 15:53:45 +02:00
Olivier Goffart
666a892fa6
winit: Don't forward synthetic event to the application
Fixes #5823
2024-08-12 14:37:38 +02:00
Olivier Goffart
563585cd45 CI: Upload the todo-mvc wasm in the nightly job
Part of #5835
2024-08-12 14:20:13 +02:00
Olivier Goffart
547e00b6f9 Tab with modifier shouldn't change focus
(eg: alt+tab or control+tab)
Failed attempt at fixing #5823
This doesn't fixes it because the problem is that the key event are
forwareded as syntetic events when we gain focus, and they are not in a
order that allow to detect alt+tab
2024-08-12 13:40:58 +02:00
Tobias Hunger
1639274486 slintpad/vscode: Get rid of the shared files
Theyre are no more shared files, so move the files
into vscode and set up a syntax check over there.

That was not possible before as the typescript
compiler would error out on the shared files being
outside its root directory.
2024-08-12 12:45:59 +02:00
Simon Hausmann
49d0c96a9e ChangeLog: Add missing backtick 2024-08-11 10:29:33 +02:00
Simon Hausmann
e311f8c09d Add LinuxKMS ChangeLog entry 2024-08-11 10:29:19 +02:00
Simon Hausmann
833883b028 Python: Fix Slint file loading in callback examples
The foo_slint import has been replaced with the auto-loader.
2024-08-11 10:27:18 +02:00
Olivier Goffart
7859d69339 Changelog for current changes 2024-08-11 10:22:37 +02:00
Olivier Goffart
51481b101c
Make conversion from float to int property truncate
- Make sure that in Rust and C++ we also truncate if the properties are
inlined
 - Change the interpreter to truncate

This is a redo of commit f5d003d but truncate instead of round

fixes #5689
2024-08-10 14:51:05 +02:00
Danut Enachioiu
8e51563609
Fix broken Android build caused by missing font field (#5821) 2024-08-10 13:37:22 +02:00
Miłosz Kosobucki
bcc5327052 Fix typo in example
Qt platform example.
2024-08-09 22:07:27 +02:00
Nathan Collins
2eff651d77 Zephyr: CI uses appropriate toolchain for the target
The simulator build requires the nightly rust toolchain, and
occasionally fails due to upstream changes to the nightly toolchain.

The hardware build does not require the nightly rust toolchain, but
still fails due to upstream nightly toolchain changes.

Move the hardware build to the stable toolchain so that it is not
broken unnecessarily.

Additionally, turn off `fail-fast` so that the nightly failures don't
affect the stable builds.

Fixes #5812.
2024-08-09 20:19:16 +02:00
Olivier Goffart
819e549278 Rust generated code: handle the case if the parent is destroyed in a binding
This can happen if somehow the parent get destroyed while a binding is
running. This is issue #3464

This is enough to fix #5698
2024-08-09 15:05:15 +02:00
Tobias Hunger
a394921479 lsp: Treat EoF as whitespace when looking for non-ws
... tokens.

Fixes: #5695
2024-08-09 12:19:03 +02:00