Commit graph

1483 commits

Author SHA1 Message Date
Simon Hausmann
95ee117897 Remove outdated comment
Amends commit 44f1602fd6
2024-10-07 16:14:11 +02:00
Simon Hausmann
0b028bfb6f
Add support for a font-metrics property to Text/TextInput. (#6452)
The struct held provides access to the design metrics of the font scaled
to the font pixel size used by the element.

ChangeLog: Slint Language: Added font-metrics property to `Text` and `TextInput`.

Closes #6047
2024-10-05 17:00:46 +02:00
Enyium
054035d930 Set icon also as big winit window icon for increased compatibility (Windows-only).
Under Windows, the big icon is shown at least in the ancient Alt+Tab dialog, which can be restored via registry tweak.
2024-10-04 15:28:08 +02:00
Olivier Goffart
785c16c71a bring_to_front should un-minimize the window
This helps for bringing the preview window back from minimized state
when clicking on "show preview" on X11
2024-10-04 10:06:02 +02:00
Simon Hausmann
f772cb8e11
live-preview: Bring the window to the front and focus it when the use… (#6295)
Fixes #196


Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2024-09-24 17:05:03 +02:00
Simon Hausmann
b2873a3d17 ui-testing: Add support for reading the computed opacity of elements
This is useful when the UI shows for example labels that appear and the screenshot for referenceing is meant to be taken when the opacity animation is complete and the value is (near) 1.0.
2024-09-19 11:28:18 +02:00
Tobias Hunger
d1420969c7 winit: Quieten warning
I am getting this warning:

```
[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
warning: missing documentation for a function
  --> internal/backends/winit/lib.rs:83:1
   |
83 | / pub fn create_gl_window_with_canvas_id(
84 | |     canvas_id: &str,
85 | | ) -> Result<Rc<dyn WindowAdapter>, PlatformError> {
   | |_________________________________________________^
   |
note: the lint level is defined here
  --> internal/backends/winit/lib.rs:6:9
   |
6  | #![warn(missing_docs)]
   |         ^^^^^^^^^^^^
```

Fix this by adding a tiny bit of documentation
2024-09-18 18:45:14 +02:00
crai0
3f3ac7e347
common: add support for back and forward pointing-device buttons (#6149)
Closes #6043

ChangeLog: add support for back and forward pointing-device buttons
2024-09-18 07:48:30 +02:00
Simon Hausmann
c1863072a8 winit: Clean up backend creation API
Use a builder pattern, which also allows configuring the event loop builder.

Fixes #6103

Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
2024-09-16 10:11:00 +02:00
Simon Hausmann
a9cb255906 winit: Rename window_builder_hook to window_attributes_hook
In winit the WindowBuilder was renamed to WindowAttributes.
2024-09-16 10:11:00 +02:00
Arnold Loubriat
f01420258f Changelog: Introduce AccessibleRole::ListItem 2024-09-16 09:15:39 +02:00
Arnold Loubriat
54992477d8 Changelog: Fix AccessKit role mapping for AccessibleRole::List 2024-09-16 09:15:39 +02:00
Simon Hausmann
5bfdfaf6c3 linuxkms: bump more dependencies 2024-09-13 17:30:19 +02:00
Simon Hausmann
44f1602fd6 Update drm/gbm dependencies
Fixes #3669
2024-09-13 16:10:10 +02:00
Simon Hausmann
d1c9d4e466 Minor tweak to framebuffer presentation error message in linuxkms backend
cc #4619
2024-09-12 13:50:30 +02:00
Simon Hausmann
d74e49e71f Skia renderer: Remove unnecessary scale factor argument / function 2024-09-10 10:24:07 +02:00
Simon Hausmann
204cf7d0db Fix wasm build 2024-08-28 21:24:42 +02:00
Simon Hausmann
394f1f0f91 Remove unused function 2024-08-28 21:24:42 +02:00
Simon Hausmann
16f47eac7d Disable the macOS system menu bar for the Slint Live-Preview
Fixes #5962
2024-08-28 21:24:42 +02:00
Olivier Goffart
43c7f57b0f spawn_local: initialize the platform if not initialized before the call
Take the opportunity to refactor a bit the way the global platform or
context is accessed

Fixes: #5871
2024-08-21 13:26:04 +02:00
Simon Hausmann
12f5343cd8 Add the window's root element handle to the window properties 2024-08-20 15:48:00 +02:00
Simon Hausmann
69e5a8a446 System Testing: Add descendent and element id/type/role matching messages 2024-08-20 15:48:00 +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
Olivier Goffart
666a892fa6
winit: Don't forward synthetic event to the application
Fixes #5823
2024-08-12 14:37:38 +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
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
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
11ce002314 macOS: Fix windows not resizing/redrawing correctly when showing again after calling hide
Don't assume that any pending redraw request will be delivered when the window his shown/hidden.

Amends 9113b877bd

Fixes #5658
2024-07-23 13:35:35 +02:00
Olivier Goffart
8eb1543832 Android: create output directory for .class
According to https://github.com/slint-ui/slint/discussions/5662 , this might be necessary
2024-07-22 15:23:46 +02:00
Simon Hausmann
28f7ee7c7d winit: Prefer X11 over Wayland when running in WSL
This is a workaround for the compositor on WSL tending to crash.
Unfortunately we can't just try to create an event loop with x11 first
and then re-try with wayland, winit doesn't allow that. So just avoid
wayland for now.

The long term solution #5667

Fixes #5657
2024-07-22 14:12:14 +02:00
Simon Hausmann
7536a6df06 Attempt to fix testing publishing 2024-07-18 12:11:21 +02:00
Simon Hausmann
592ecc2f08 Permit publishing of testing crate 2024-07-18 12:06:35 +02:00
Simon Hausmann
9e8fccb742 system testing: Add support for dispatching pointer and key window events 2024-07-16 14:10:22 +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
790ae9c1bb Remove last use of ElementHandle::visit_elements from Rust testing API 2024-07-15 11:30:34 +02:00
Simon Hausmann
1c2a8f2d2f Replace uses of ElementHandle::visit_elements with matches 2024-07-15 11:30:34 +02:00
Simon Hausmann
b67fcce4a3 Add a new descendants api as well as deeper element queries to ElementHandle 2024-07-15 11:30:34 +02:00
Olivier Goffart
b9dc73bc6a Android: Print a warning when there is an error from the build script JDK 21
It doesn't compile:
```
Dex conversion failed: Error in ...\out\java\dev\slint\android-activity\SlintAndroidJavaHelper$1.class:
java.lang.NullPointerException: Cannot invoke "String.length()" because "" is null
```

I don't know how to solve the error, but i can giv an informative
message telling them to downgrade Java

CC: #4973
2024-07-11 13:30:13 +02:00
Simon Hausmann
0be2d4521e API Review: Remove suspend/resume related functions from FemtoVG renderer
This could've been `set_opengl_context` taking an `Option`, but it turns
out that makes for an awkward interface when wanting to pass None,
because that also then requires a dummy type for the OpenGL context even
though none is wanted.
2024-07-08 12:23:56 +02:00
Simon Hausmann
877bf786b8 Add support for RGB565 linux framebuffer rendering 2024-07-08 11:55:57 +02:00
Simon Hausmann
a16e86bbd9 API review: Remove accidental public strum dependency
Deriving strum::EnumIter on a publicly exposed enum (like PointerEventButton) implies visibility into types that strum declares. This was added just for testing
in systest and can be solved differently.

Amends a1857e6154
2024-07-05 20:48:25 +02:00
Simon Hausmann
89b80eb00e API review: move {window,display}_handle_06_rc() into WindowAdapterInternal 2024-07-05 20:48:02 +02:00
Simon Hausmann
e35d05f6b9 API Review: Remove SharedImageBuffer from public API and rename Window::grab_window() to take_snapshot()
Use SharedPixelBuffer as return value for take_snapshot() and provide counter-parts to from_rgb* in Image as to_rgb*
2024-07-05 20:46:55 +02:00
Olivier Goffart
8b5df70dd0 Make a trait for the Text rendering
So we can Split Text
2024-07-05 12:51:25 +02:00
Olivier Goffart
7c93c7438b Rename resize-border => resize-border-width 2024-07-05 12:50:16 +02:00
Noah Sweilem
6095398374
Winit window event filter (#5531)
* Add winit window event filter (#3066)

* Winit window event filter changelog entry

* Format fixes

* More format fixes

* Make requested changes

- Callback gets a ref to the Slint window
- Callback returns an enum
- Callback is no longer `Send`

* Format fixes

* More format fixes

* Merge conflict fixes

* Rename members of `WinitWindowEventResult`

Closes #3066
2024-07-04 17:41:57 +02:00
Simon Hausmann
1ab68d53ed winit: remove unnecessary helper function to access winit window 2024-07-03 18:01:48 +02:00
Simon Hausmann
cc1038baf8 Oops, fix non-wasm build 2024-07-03 16:06:47 +02:00