Commit graph

1507 commits

Author SHA1 Message Date
Simon Hausmann
2b6938bce8
Node.js: Avoid running epoll() in the wayland event loop when pumping… (#7682)
Work around pump_events() with `Some(std::time::Duration::ZERO)` still entering `epoll` and thus not returning, preventing us from processing node events.

cc  #7657


Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2025-02-21 14:50:20 +01:00
Arnold Loubriat
cc91de2d38 Add the accessible-read-only property 2025-02-19 09:16:41 +01:00
Arnold Loubriat
90c337f1d1
Add AccessibleRole::Image and use it in the AboutSlint widget (#7593)
* Add `AccessibleRole::Image`

* Improve accessibility of the `AboutSlint` widget

* Filter out some images from the accessibility tree
2025-02-18 09:43:53 +01:00
Olivier Goffart
ce7a785138
Qt: don't clear selection when the window gain focus
(or popup menu gets closed)

We receive an empty `QInputMethodEvent` when the window gets active
and we should not have a replacement range if there is nothing to
replace, otherwise we clear the selection
2025-02-11 18:10:09 +01:00
Olivier Goffart
22317d29b4
Qt: Fix event forwarding for native popups
So that popup menus can handle hover events.

This also remove some of the code in the qt backend that used the
private API
2025-02-11 17:11:43 +01:00
Olivier Goffart
ceb7ea00f5
Qt: don't call deleteLater on the main widget
Otherwise we crash at exit

Fixes #7570
2025-02-11 12:53:53 +01:00
Simon Hausmann
9195f3e265 Fix build with renderer-skia-vulkan
We always offer the Skia software renderer fallback in
`new_try_vulkan_then_opengl_then_software`, so make sure that the drm
and mmemap dependencies are activated, needed to compile swdisplay.rs.
2025-02-11 09:15:38 +00:00
Simon Hausmann
479bee7c87 Add support for exposing PopupWindow instances in the element tree when active 2025-02-10 13:57:55 +01:00
Simon Hausmann
8372cd6412
Convey clipping of children to accesskit (#7587)
and while at it, move is_clipping_item() that casts a function of the ItemVTable.

Fixes #2341
Fixes #7382
2025-02-10 13:42:10 +01:00
Arnold Loubriat
9375f9a08b Track the accessible-delegate-focus property of the focused item 2025-02-09 21:36:52 +01:00
Yuri Astrakhan
6324b35e94 Auto-fixed clippy::needless_borrow
`__CARGO_FIX_YOLO=1` is a hack, but it does help a lot with the tedious fixes where the result is fairly clear.

See https://rust-lang.github.io/rust-clippy/master/index.html#/needless_borrow

```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::needless_borrow

cargo fmt --all
```
2025-02-07 09:02:45 +01:00
Yuri Astrakhan
bcb2953f00 Auto-fixed clippy::unnecessary_map_or
This is a hacky approach, but does help a lot with the tedious fixes.

See https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_map_or

```
__CARGO_FIX_YOLO=1 cargo clippy --fix  --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::unnecessary_map_or

cargo fmt --all
```
2025-02-07 09:02:31 +01:00
Yuri Astrakhan
4ae2627ade A few more format arg inlining
Used these commands and some manual searching

```
cargo clippy --fix  --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::uninlined_format_args
cargo clippy --all-targets -- -A clippy::all -W clippy::uninlined_format_args
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2025-02-07 06:43:19 +01:00
Yuri Astrakhan
5356fdcf89 Fix clippy issues, plus a few manual cleanups
* Run `cargo clippy --fix`
*  `BackendSelector` is easier to instantiate with auto `Default`
2025-02-06 17:28:51 +01:00
Olivier Goffart
2846c35055
TextInput: implement page up/down
CC #474
2025-02-06 14:52:28 +01:00
Simon Hausmann
d855b44668 Always create an app menu for the menubar
This is the discussed stop-gap for macOS for the 1.10 release.
2025-02-06 14:42:20 +01:00
Yuri Astrakhan
61de4d56b0 Fix all format arg inlining
Ran this command:

```shell
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2025-02-06 10:16:20 +01:00
Arnold Loubriat
358e42a8d5 Add the accessible-action-expand action 2025-02-03 20:32:45 +01:00
Arnold Loubriat
f30f953ffd Add the accessible-expanded property 2025-02-03 20:32:45 +01:00
Arnold Loubriat
53fd7b12e4 Add the accessible-expandable property 2025-02-03 20:32:45 +01:00
Simon Hausmann
a28ec80917 winit: Fix support for menu bars provided by native code
Add `with_default_menu_bar` to winit's `BackendBuilder` to permit applications
to provide their own menu bar.

Fixes the lsp's Window -> Keep on top menu on macOS.
2025-02-03 11:30:03 +01:00
Simon Hausmann
2a5e35a5e8
Fix typo 2025-01-31 21:59:05 +01:00
Simon Hausmann
5ff5c0464c Fix crash when AccessKit is active and combobox is opened
Opening a combobox with the winit backend implies creating a popup and a transfer of focus. The former will re-create the accessibility tree and cause pending_update to be set to true. The latter will send a notification to the accesskit adapter and unfortunately the (new) focus node will not be known to accesskit yet, causing it to panic.

Since we have a pending update and the new tree update will include the correct focus, we can just sking sending one in this moment.

Fixes #7403
2025-01-31 15:28:42 +01:00
Olivier Goffart
0d72bb0a72 Remove experimental flag for MenuBar and ContextMenu 2025-01-31 14:05:28 +01:00
Simon Hausmann
c0948f83e5 Fix panic when using the scroll wheel with linuxkms
Don't use todo!().
2025-01-30 12:56:05 +01:00
Simon Hausmann
a4709b211e Cleanup: Rename bounding_rect_for_geometry to bounding_rect 2025-01-30 10:55:28 +01:00
Simon Hausmann
85b91bd325 Reduce size of CachedItemGeometryAndTransform and fix filter_item to respect the bounding rect
Remove the geometry field and merely store the offset/transform. This brings the size down from 40 to 32 bytes on aarch64.

Related, filter_item() now respects the item's bounding rect for the decision whether to draw the item or not.
2025-01-30 10:55:28 +01:00
Simon Hausmann
4a6b4d9dfa Add support for bounding text rendering with the partial renderer
cc #7247
2025-01-30 10:55:28 +01:00
Simon Hausmann
58ea5389f8 Add support for box shadows with the partial renderer
cc #7247

Fix comment in partial renderer's filter_item() about dependency tracking

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2025-01-30 10:55:28 +01:00
Olivier Goffart
e75415554a Create a menus module in i-slint-corelib 2025-01-30 10:08:22 +01:00
Simon Hausmann
05e70e8c8b Fix support for Window.background tracking with the partial renderer
Fixes #5219
2025-01-29 16:32:42 +01:00
Simon Hausmann
cf9b515a92 Clean up rendering of component container
Instead of creating a dummy Rectangle with background property, implement a RenderRectangle trait.
2025-01-29 12:39:40 +01:00
Arnold Loubriat
c739f1e9ba Slider widget: react to Home and End keys 2025-01-25 21:30:22 +01:00
Simon Hausmann
de87bf2a43 Update to new objc2 versions 2025-01-24 18:57:09 +01:00
Simon Hausmann
0d723953f9 Add support for line caps in Path Strokes
ChangeLog: Added `Path::stroke-line-cap` property.

Fixes #4676
2025-01-20 22:28:45 +01:00
Simon Hausmann
7816078593 linuxkms: Fix build
Ooops
2025-01-17 10:54:00 +00:00
Simon Hausmann
d17025dd3c linuxms: When we fail to open a DRM device, include the path in the error message 2025-01-17 10:51:39 +00:00
Olivier Goffart
4985421d6c Android: fix parsing of version output
The version of the JDK 24 constains a `-`

Fixes #4973
That issue can be closed as it works with newer android SDK

ChangeLog: fix build with newer JDK
2025-01-16 14:38:47 +01:00
Simon Hausmann
1bc4f8e7d3 backend-winit: Don't call deprecated xdg settings portal method
Read() returns the value wrapped in a variant, which still works because
downcast_ref() recurses, but it's deprecated and we should be calling
the right function.

Thanks @bilelmoussaoui for spotting!
2025-01-16 09:57:00 +00:00
Simon Hausmann
22ad614bf4 Fix formatting 2025-01-15 19:09:55 +01:00
Simon Hausmann
5030d66765 Replace ashpd dependency with just zbus
This makes our dependency tree lighter and zbus is an already existing dependency (through accesskit).

cc #7276
2025-01-15 17:32:00 +01:00
Olivier Goffart
8a5df27469
Update to Image 0.25 (#7365)
Added image-default-formats with all the format supported by image by
default, and enable that feature by default.
Also put that feature in compat-1-2 for compatibility with user that
have used image 0.24 with enabled features.
Make a new compat-1-10 feature that does not enable default format by
default

ChangeLog: upgraded image crate to 0.25, added a new cargo feature
to enable all image formats. (that feature is enabled by default with
compat-1-2, added compat-1-10 to disable it

Fixes https://github.com/slint-ui/slint/issues/7251
2025-01-14 16:31:05 +01:00
Simon Hausmann
53f2d572b1 Remove some uses of once_cell 2025-01-14 14:18:24 +01:00
Simon Hausmann
67cd3d7aad linuxkms: Bump gbm dependency 2025-01-14 13:55:53 +01:00
Tasuku Suzuki
346d1c2df3 Fix typos
Ran `typos .` and fixed all typos that do make sense.
https://crates.io/crates/typos
2025-01-13 08:35:20 +01:00
Arnold Loubriat
dec3bff5e2 Remove an unused import to fix a warning 2025-01-13 08:19:33 +01:00
Olivier Goffart
e34c19325c
Fix closing PopupWindow when the click opens another PopupWindow
Fix #7322
2025-01-10 21:57:35 +01:00
Simon Hausmann
aa332202c5 Rename AccessibleRole.GroupBox to AccessibleRole.Groupbox
While unfortunate in casing, this is consistent with Checkbox, Combobox, and Spinbox.
2025-01-10 16:27:14 +01:00
Olivier Goffart
3e94bd2167 Janitor: Remove trailing whitespaces from all files
`git grep -I -l -O'sed -i "s/[[:space:]]*$//"' -e ''`
2025-01-10 13:23:22 +01:00
Simon Hausmann
41559d30e2 Fix default menu on macOS with muda
As discussed, always disable winit's menu. Let either the user (with a custom event loop builder) or us provide a menu.

Amends 5acd931966
2025-01-10 11:22:10 +01:00