Commit graph

1514 commits

Author SHA1 Message Date
Simon Hausmann
604450da47 WIP: slint-compiler: Add support for generating Python stubs
The generated file offers the following two pieces of functionality:

- Convenient front-end to slint.load_file() by loading the .slint file
  (replaces use of auto-loader)
- More importantly: Type information for exported properties, callbacks,
  functions, and globals
2025-07-14 13:36:39 +02:00
Simon Hausmann
5e8f2e4447 Fix warning with nightly about unnecessary parentheses 2025-07-11 08:26:30 +02:00
Olivier Goffart
e5e3128986 Binding analysis: We shouldn't report binding loop based on base bindings
In this case, there is an explicit binding in the PopupWindow::width,
so we shouldn't continue and find loop based on the implicit bindings

Fixes #8889
2025-07-11 05:16:25 +02:00
Olivier Goffart
01850e0b82 C++ live-reload: support getting the model back 2025-07-09 11:23:33 +02:00
Olivier Goffart
43b436a89f WIP: live-reload for C++
Missing feature:
 - conversion between Value and enums
 - conversion from value to Model
 - Compatibility with the testing framework (get the `VRc<ItemTreeTable>` from an instance)
2025-07-09 09:32:17 +02:00
Olivier Goffart
5f4a0a352d
live-reload: support slint!() macro 2025-07-08 12:19:04 +02:00
Olivier Goffart
d49fe14e4a
Menu: avoid using padding properties (#8847)
Padding properties exists as reserved properties but don't have effect.
But the menu code was using them to store values.

This is now a warning because people got confused by setting padding and
wondering why it has not effect.
This also had some bug in the code were properties were padding was set
on a layout, as well as all the padding-* properties, so the padding was
not taking in account
2025-07-04 16:42:59 +02:00
Olivier Goffart
647dd45213 Make a live reload module in the slint-interpreter 2025-07-04 10:07:22 +02:00
Olivier Goffart
cc9c573c9a Rust codegen that forward to the interpreter (live-reload)
When the SLINT_LIVE_RELOAD env variable is set, generate a component
that will forward everything to the interpreter instead of generating
everything.

Fix running the test driver rust with the SLINT_LIVE_RELOAD

```
SLINT_LIVE_RELOAD=1 cargo test -p test-driver-rust --all-features --features=slint/live-reload
```
2025-07-04 10:07:22 +02:00
Olivier Goffart
d2b3287876 ComponentHandle: don't rely on the Inner to be a VRc<ItemTreeVTable>
Because i want to be able to hold componetns that do not directly
implement ItemTreeVTable, but only forward to it
2025-07-04 10:07:22 +02:00
Olivier Goffart
05f48b0fee Rust codegen: ensure alignment of Texture
Some checks are pending
CI / test-figma-inspector (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / files-changed (push) Waiting to run
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, 1.85) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.85) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
Some hardware acceleration routine needs it to be aligned.
(Eg, Otherwise, we get artifacts when drawing RGBA images with nema-gfx)
2025-07-03 12:35:39 +02:00
Olivier Goffart
ced9a60544 compiler: Dialog padding has effect and shouldn't be a warning 2025-07-03 10:25:16 +02:00
Olivier Goffart
a007ca8c60 Add a compiler warning when using padding outside of layout
The padding property is accepted but doesn't have an effect.
It was meant for future use but didn't get any use.
And people get confuse when they set it. (See #8829)

Closes: #8829
Closes: #6288
2025-07-02 11:08:12 +02:00
Tobias Hunger
7f331c6bd9
compiler: Add SLINT_TEST_FILTER to syntax tests (#8673)
... so that you can only run certain tests you care for.
2025-07-01 14:24:55 +02:00
Olivier Goffart
ac24e0274e Rust: fix compilation if the slint code declares struct named core 2025-06-30 13:36:01 +02:00
Olivier Goffart
73dc1c7cdc compiler internal docs: expend the menu lowering docs
Some checks are pending
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, 1.85) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.85) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
2025-06-29 17:27:15 +02:00
+merlan #flirora
9a1ccaf502
Update fdsm dependency to 0.7.0 (#8524)
Some checks are pending
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / files-changed (push) Waiting to run
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, 1.85) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, 1.85) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
2025-06-27 08:46:19 +02:00
Joshua Goins
c09ed19a85 Menu: Add icon property
This adds an icon that is displayed to the left of the title, and is
also shown for Menus are inside of a parent menu.

Closes #7791

ChangeLog: Added icon property to MenuItem and Menu
2025-06-26 18:45:37 +02:00
Olivier Goffart
3823c1e8da Experimental support for Drag & Drop
Add a `DragArea` and `DropArea` elements.
It is currently gated as experimental.
2025-06-26 15:39:18 +02:00
Avery Townsend
d2a5ae03dc
Add local variables (#8740)
Fixes: #2752

ChangeLog: Added local variable with `let`
2025-06-26 15:36:49 +02:00
Varin Thakur
3640cb8b97
Allow simplified callback handler without curly braces, (#8764)
Closes #8401

ChangeLog: Callbacks handler no longer need curly-braces. Extra semi-colon is no longer an error.
2025-06-26 15:33:56 +02:00
ogoffart
9cc24ff284 Bump version number to 1.13.0 2025-06-26 13:30:43 +00:00
Olivier Goffart
ad2766518e
Fix comparison between int and float
We should not cast to int

Fixes #8778

ChangeLog: Fix comparison of int and float
2025-06-25 19:54:15 +02:00
Simon Hausmann
e45baccaaf Fix accessing the Platform global from within other globals
The platform lowering pass was called before we collected globals, so visit_all_used_components never called the pass on any globals.

Fixes #8777
2025-06-25 12:56:51 +02:00
Olivier Goffart
54b076d4a2
Compilation error with empty enums
Technically a breaking change, although code generation was very likely
to panic.

Fixes #8743

ChangeLog: Enums without value cause compilation errors (instead of panics)
2025-06-23 12:43:02 +02:00
Olivier Goffart
601c030bea codegen: Don't generate unused struct
This fixes a warning in nightly rust which has been better at detecting
unused struct

```
error: struct `TextStyle` is never constructed
  --> /home/runner/work/slint/slint/target/debug/build/slint-lsp-da851cbad8b87459/out/main.rs:78:66
   |
78 |      # [derive (Default , PartialEq , Debug , Clone)] pub struct r#TextStyle {
   |                                                                  ^^^^^^^^^^^
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`
```

Where TextStyle is only used in some globals whose properties are fully
inlined. So first do the pass that removed unused global, and then the
pass that remove unused struct
2025-06-23 11:32:31 +02:00
Olivier Goffart
c21064485e Compiler: Fix invalid code gen with return statements
Some checks are pending
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.82) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
Fixes #8723
2025-06-18 12:58:59 +02:00
Olivier Goffart
20061392cd
C++: Fix compilation of PopupWindow::show in changed callback
Some checks are pending
CI / ffi_32bit_build (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / files-changed (push) Waiting to run
CI / build_and_test (--exclude bevy-example, ubuntu-22.04, 1.82) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, --exclude bevy-example, windows-2022, 1.82) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.82) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
The window is dependent of an lambda `auto` parameter, so the `template` keyword is required in order to call show_popup

Fixes #8710
2025-06-16 23:25:24 +02:00
ogoffart
92f9f0e85d Bump version number to 1.12.1 2025-06-16 13:32:39 +00:00
Simon Hausmann
06a19e59ad
slint: Change Platform.os to return a new enum OperatingSystemType (#8679)
* slint: Change Platform.os to return a new enum OperatingSystemType

cc #8631
2025-06-12 14:25:16 +02:00
Olivier Goffart
c0cac46009 Add --generate-link-to-definition in the docs of all our published crate
This is a nice nightly rustdoc feature and we should make use of it
2025-06-06 21:47:36 +02:00
Olivier Goffart
7b4d2fd3d3 Renames after the API review
CC #8631
2025-06-06 12:31:50 +02:00
Simon Hausmann
114a7853b2 CI: Fix remaining lifetime annotation warnings
Amends de81fa1dba
2025-06-06 11:47:14 +02:00
Simon Hausmann
de81fa1dba CI: Fix build with nightly and -D warnings
Add life-time annotations as recommended by the compiler to clarify
the flow of life times of arguments to the output.
2025-06-06 11:38:50 +02:00
Tobias Hunger
93f72b8c99 core: Fix the component container
Some checks are pending
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.82) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
This fixes the contents of the `n`-th repeater inside the
`ComponentContainer` to also show up in the `n`-th repeater *after*
the `ComponentContainer`.

The ComponentContainer is lowered to a Comonent Container and a
dynamic tree node. The tree node is managed manually and I messed
up the repeater indices since there were no entries in the repeater
array for the embedded components. That mad things hard to keep
consistent as components get merged.

This chnages that: It lowers a Component Container to Something like this:

```slint
    ComponentContainer {
        if false: Emtpy {}
    }
```

This way the standard mechanismns make sure we have something to put into
the repeater list and that unscrews the indices, saving a bit of code along
the way.

The inserted repeated node is still marked as `is_component_placeholder`, so
that we can wire it up as needed.
2025-06-05 13:48:16 +02:00
Avery Townsend
8c4ccabf7d
Expose FocusReason to .slint as an argument in focus-event-changed and add focus-gained and focus-lost callbacks (#8569)
This exposes FocusReason to .slint, and adds it as an argument to focus-event-changed callback on FocusScope to close #8387. It also adds two new callbacks, focus-gained and focus-lost, which are identical to focus-event-changed but are only invoked on focus gain or loss respectively.

In addition to this, it removes the FocusEventReason::AccessKit variant, replacing it with the mouse variant to hopefully make AccessKit more compatible with any Slint code that will use FocusEventReason.

Finally, I added two tests based on focus_change_event.slint, one for testing the FocusEventReason argument and another for testing the new callbacks.

close #8387

ChangeLog: Added `focus-gained` and `focus-lost` callback to FocusScope.  Pass an `FocusReason` enum to the FocusScope callbacks
2025-06-04 09:51:26 +02:00
Olivier Goffart
db18f4e2e5 Change the new error that detects binding loop through the window into a warning
In 80de96488a (#3397) we introduced a new
error if we detect a binding loop from the Window geomerty to its layout.
But it looks like this causes a lot of error in existing project, so
make it a warning instead.

It will continue to be an error in the live preview as this will cause a
panic otherwise.

This commit also change the text of the error to include the actual
binding loop. I hope this makes it easier for users to see the loop and
help to fix it.
2025-06-02 19:01:47 +02:00
Olivier Goffart
505d22594d Path: use the Display instead of the Debug error for path
Still not perfect but a bit better than before
2025-06-02 18:19:44 +02:00
Olivier Goffart
12393e21bd
syntax_tests: allow to update tests, and don't use a regexp (#8589)
* syntax_tests: allow to "bless" tests, and don't use a regexp

A regexp was used at the beginning because I thought we would want to
allow error to contains things that were not predictable or that would
often change. But this is not the case¹. It is better to actually test
for the full error message

¹ well actually it was the case for path, but there is another substitution to 
 `📂` for the manifest directory

* syntax_tests: Bless the tests

* syntax_tests: Manual adjust after bless

Because there used to be comments on the same line of the message which
bless don't support

* Fix error message with path on windows

 - The debug implementation of path make double slash, that's not what
   we want to show the user
 - normalize paths to use `/` so the test passes
2025-06-02 16:47:33 +02:00
Tobias Hunger
ce8b42b3a1 live-preview: Get better basic values for the property editor 2025-06-02 13:28:25 +02:00
Olivier Goffart
dc915b1af3 C++: add asserts that we are in the main thread
Some checks are pending
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.82) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
- In the timer functions
 - in the generated getter/setters and callback invocation
2025-05-28 11:29:48 +02:00
Tobias Hunger
25c1085b50 compiler: Add a struct to hold a ChildrenInsertionPoint
I expect I will need to add something here to handle
indices on children and then a tuple might get unwieldy.
2025-05-27 10:49:26 +02:00
Avery Townsend
c41d4a4df3
Add FocusEventReason to FocusEvent and add a select all on keyboard focus for TextInput (#8523)
Closes #5992

Adds the enum FocusEventReason and makes it an argument for FocusEvent. This reason could eventually be exposed in Slint to solve #8387.

Using the focus reason tracking, I also added a select all on keyboard focus for TextInputs (except on macOS), which should close #5992.

ChangeLog: TextInput selects its content when focused with the keyboard on Windows and Linux
2025-05-27 07:56:13 +02:00
Avery Townsend
f7fa27b9b4
added mouse-drag property to ScrollView (#8512)
Closes #2260
2025-05-26 22:22:57 +02:00
Olivier Goffart
2f2116686f C++: forward declare explicitly to make the code more robust
We currently forward declare classes as we use them in functions.
But this breaks if classes with the same name were declared in the
parent namespace. As shown with this example

```C++
// Uncomment that line to make the code break
//struct SharedGlobals;

namespace ns {
    // Is that a forward declaration in `ns`?
    // Depends if it was declared before in the parent namespace
    void foo(struct SharedGlobals *x) {}

    // Actualy define ns::SharedGlobal
    struct SharedGlobals { int x; };

    int xyz() {
        SharedGlobals globals;
        foo(&globals);
    }
}
```

So make sure we forward-declare the classes properly to be more robust
and be able to include generated file with namespace after a file
without namespace

CC #2909
2025-05-26 18:32:09 +02:00
Olivier Goffart
c3021ff955 compiler: Fix materialize of absolute-position in timer callback
Noticed that while working on bug #8541
2025-05-26 15:44:11 +02:00
Olivier Goffart
f504064921 binding analytics: properly visit timer properties and callback
Fixes #8541
2025-05-26 15:44:11 +02:00
Tasuku Suzuki
83db461f63
Transition: Introduce in-out to allow writing symmetry animation (#8509) 2025-05-26 09:17:22 +02:00
Olivier Goffart
18c3ae53d2 Compiler: Fix generated invalid expressions in remove_return pass
... when the two branch of a if/else return, and one of the branch has
also non-terminator return in sub conditions

Fixes #8485
2025-05-23 12:28:57 +02:00
Tobias Hunger
447ee5de44 live-preview: Handle colors/brushes using palette names
Find color names/values defined in palettes in property bindings.

Make sure to not report those as code.

Do a lot more complex evaluation of color values "behind" the palette name
to get a useful value out for the palete name. This will e.g. follow the
true branch of conditions, handle Structs, struct field access and references to
globals when looking for the color value.
2025-05-21 16:28:03 +02:00