Commit graph

11467 commits

Author SHA1 Message Date
Simon Hausmann
1ab68d53ed winit: remove unnecessary helper function to access winit window 2024-07-03 18:01:48 +02:00
Simon Hausmann
0f158e10dd testing api: Avoid bogus warnings about missing debug info
A `Rectangle { clip: true; }` will generate an intermediate `Clip` rectangle, which
certainly has no debug info.

The check whether debug info is present or not should not be done on a per-element
level but it can be done on the level of the compilation unit.
2024-07-03 18:01:24 +02:00
Olivier Goffart
708ab9f7c2
viewer: use the new Compiler API and add a --component command line arg 2024-07-03 16:49:22 +02:00
Olivier Goffart
875d20f1ac Add test for deprecated import
Should have been part of a0dd978f8a
2024-07-03 16:44:31 +02:00
Simon Hausmann
cc1038baf8 Oops, fix non-wasm build 2024-07-03 16:06:47 +02:00
Simon Hausmann
c1e1a81b93 Fix some wasm build warnings 2024-07-03 15:46:28 +02:00
Simon Hausmann
e497effd73 FemtoVG: Fix rendering notifier invocation when suspending and resuming the renderer 2024-07-03 14:22:30 +02:00
Simon Hausmann
2f4b633807 Simplify FemtoVG new() constructor
Build it on top of the new new_suspended() and resume() functions to reduce code duplication.
2024-07-03 14:22:30 +02:00
Simon Hausmann
38bc37f72a Add missing dispatch of resize event to the window item when the user resizes the window while being hidden 2024-07-03 14:22:30 +02:00
Simon Hausmann
dd49ecacf3 Make an effort to avoid returning None from WindowAdapter::position() when we have no native window
When the user queries the physical position of the window after setting a logical position, but we don't have a window, use the last known scale factor.
2024-07-03 14:22:30 +02:00
Simon Hausmann
8c1ee12f84 Remove outdated comment
The new enum keeps the winit::window in an Rc (and we did before as well).
2024-07-03 14:22:30 +02:00
Simon Hausmann
a75b9fe643 Clean up WinitWindowAdapter construction
Call resume() on the renderer in one place, instead of several.

Co-Authored-By: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
2024-07-03 14:22:30 +02:00
Simon Hausmann
49df131625 Fix slint::Window::hide() on Wayland with winit
On Wayland hiding a window requires destroying the surface, which
means destroying the winit window as well as the underlying graphics
surface. The latter is tricky as we have to keep the renderer around,
as our WindowAdapter trait's `renderer()` function returns a `&dyn
Renderer` and that also has to work without a window (to obtain text
metrics).

Fixes #4225

Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
2024-07-03 14:22:30 +02:00
Simon Hausmann
862b1e1dfe winit software: remove unneccessary winit_window rc field
We can obtain that from the softbuffer surface.
2024-07-03 14:22:30 +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
Simon Hausmann
5afb9768c5
Fix crash on app shutdown on Wayland (#5534)
Valgrind would report invalid reads on the wayland clipboard shutdown code, suggesting that the wayland
display has already been destroyed.

Since the display handle isn't refcounted, we must make sure that the wayland clipboard is around as long as the wayland display handle, provided by the winit event loop.
2024-07-03 13:05:06 +02:00
Olivier Goffart
66370b6bda
Add export { ... } from "....slint"; syntax. (#5533) 2024-07-03 12:50:40 +02:00
Danut Enachioiu
033e4de9b9
Update language-specific docs to document that public functions can be called from the backend code (#5522)
* Examples for calling public functions in language-specific docs.

* Update the function example so it actually uses its parameter.

(This broke some c++ tests because of the unused argument warning)
2024-07-03 12:13:08 +02:00
aurindam
07e10f37ab Update from slint-ui/website
Update index.html from commit 13b13f0f64e81eb116d9f31a1a642063d979287b (refs/heads/prod)
2024-07-03 10:05:16 +00:00
Olivier Goffart
f93729ffe2 Port LSP to slint_interpreter::Compiler
Add a feature to only generate a specified component.
2024-07-03 11:51:23 +02:00
Simon Hausmann
bc458ebb26 Add rotation properties to the Text docs
Amends 7896e645b2
2024-07-03 11:16:58 +02:00
Simon Hausmann
97de0d8ad8 Fix VS code extension not loading when building with latest wasm-pack
The latest wasm-pack version creates, by default, a package.json
that has a "type": "module" entry in it.

We invoke wasm-pack to build the lsp module and store it in the out/
folder. Next we run esbuild to place out/extension.js - the main entry
point - into the same directory. That directory now also has the
wasm-pack generated package.json, which has the "type": "module", which
doesn't match our CJS out/extension.js.

When VS code does require("/path/to/extension/out/extension.js"),
node.js complains that extension.js is not an ESM because
out/package.json claims that it should be.

The fix here is to not generate the package.json file we don't need
anyway.
2024-07-03 10:42:51 +02:00
Simon Hausmann
4a1bb190a9 Add rotating text to the rotate example 2024-07-03 09:08:23 +02:00
Simon Hausmann
7896e645b2 Permit rotation properties on Text elements without children
This works with Skia, Qt, and FemtoVG.

cc #1481
2024-07-03 09:08:23 +02:00
Olivier Goffart
c250865032 Javascript: Multiple components 2024-07-02 13:38:52 +02:00
Olivier Goffart
e9e987a736 Fix warnings: there is no "std" feature in that crate 2024-07-02 13:34:11 +02:00
Olivier Goffart
a460bdd94f Improve coverage of Rust nightly in CI
Usefull to know in advance what warnings our users might get early enough
2024-07-02 13:34:11 +02:00
Olivier Goffart
60569673b5 Remove some cargo:rustc-check-cfg output:
- The cfg_aliases crate does it out of the box already
 - Don't create a build.rs for this only purpose when it can be added in
   Cargo.toml lints group. (This wasn't possible when the warning was
   first introduced in nightly)
2024-07-02 13:33:48 +02:00
Olivier Goffart
161a734805 Qt: fix unexpected_cfgs warning
We didn't emit the directive for all features
2024-07-02 11:50:27 +02:00
Olivier Goffart
72ab6582c4 Update changelog 2024-07-02 11:48:51 +02:00
Olivier Goffart
1baf227e9e Update AccessKit 2024-07-02 11:45:46 +02:00
Simon Hausmann
7d270812a3
Fix panic in slint::Timer due to double mutable borrow (#5525)
When stopping a timer, the removal from the timer list requires a mutable borrow.
If during that borrow the timer's closure is dropped and a `Drop` impl starts another time, then the attempt of
acquiring a mutable borrow for the timers list to insert the new timer fails.
2024-07-02 11:20:30 +02:00
Simon Hausmann
0c7d2062a5 Python: Add support for exporting multiple components 2024-07-02 10:52:22 +02:00
Simon Hausmann
a3435d218f Remove macOS-11 from the list of supported platforms
It's not supported by Apple anymore since September 2023
2024-07-02 10:48:13 +02:00
Simon Hausmann
0aaf5b57ab Fix formatting 2024-07-02 09:23:09 +02:00
Simon Hausmann
089e6280ab Fix cpp package build in the CI
macOS-11 is gone from the GH CI.
2024-07-02 08:53:10 +02:00
Simon Hausmann
a24c04fd84 linuxkms: Fix build with just renderer-skia
That one also falls back to software and when used with linuxfb needs
the timer based animation driver.
2024-07-02 08:50:42 +02:00
Olivier Goffart
02c43c66bd Use the new interpreter Compiler API in tests 2024-07-01 15:00:46 +02:00
Olivier Goffart
dbf4ca6e59 Interpreter: add the Compiler struct 2024-07-01 15:00:46 +02:00
Olivier Goffart
5bd352c430 Intepreter: Create a CompilationResult types that can hold Several ComponentDefinition 2024-07-01 15:00:46 +02:00
Tobias Hunger
e0ac115edd janitor: vtable: Fix struct SelfInfo is never constructed
Fix a build time warning.
2024-07-01 12:38:34 +02:00
Simon Hausmann
6d14f5ca15 Fix unused type warnings in i-slint-backend-linukxms build with default features
When no features are enabled, the TimerBasedAnimationDriver would be unused.
2024-07-01 11:33:46 +02:00
Tobias Hunger
dbde3c2f9e janitor: Remove unused variable warning in winit 2024-06-28 18:59:01 +02:00
Tobias Hunger
5663aa0cfd live-preview: Navigate to property
Clicking on an existing property in the PropertyEditor will ask
the editor to navigate to the right place.
2024-06-28 18:55:32 +02:00
Tobias Hunger
c9c293e3bd live-preview: Show properties of previewed element
... if no other element is selected.
2024-06-28 18:53:02 +02:00
Simon Hausmann
fd8bc22b40 Fix rustdoc warning about link to non-existent function 2024-06-28 15:33:59 +02:00
Simon Hausmann
bf919d300d Work around sometimes missing resize event on macOS with winit
Fixes #5509
2024-06-28 15:26:36 +02:00
Olivier Goffart
75539f0557 Some documentation for the property changed callbacks
Still in comments as this is experimental
2024-06-28 14:46:12 +02:00
Olivier Goffart
263af149c0 changed callback: limit chained callback to 10 invocations
in order to avoid infinite loops
2024-06-28 14:46:12 +02:00
Simon Hausmann
7f05b8aa39 Changed ElementHandle click API to a single_click and double_click function taking the button
That way one can also simulate double right click, for example. This is a little less convenient, more generic, but a reasonable compromise (perhaps :-)
2024-06-28 13:56:51 +02:00