Commit graph

1483 commits

Author SHA1 Message Date
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
Simon Hausmann
5acd931966 Enable muda macOS menubar on macOS
Hide the winit menu bar and provide a fallback if the app doesn't
provide one. Also, activate per window to fix support for multiple
windows.
2025-01-10 10:49:26 +01:00
Simon Hausmann
c764da4aab
Add property to toggle anti-aliasing on Path elements (#7308)
This enables working around bugs in GPU drivers. Especially the GC7000UL
plus its driver on imx8mp has been observed to sometimes horribly degrade in
performance when Skia renders anti-aliased paths (when a function like
`gcoSURF_BlitCPU` shows up at the top of `perf` that's a bad sign).
2025-01-10 10:28:01 +01:00
Olivier Goffart
cfbcf0b1d7
Introduce Window::try_dispatch_event (#7313)
That is the same as Window::dispatch_event, but it reports an error
instead of panicking
2025-01-09 19:39:38 +01:00
Simon Hausmann
0774681196 doc: use rust doc comments for DumbBufferDisplay fields 2025-01-09 16:26:24 +01:00
Simon Hausmann
31912fedaf LinusKMS: Clean up and simplify presenter interface
With the drm output now waiting for the page flip on render *and* gbm and dumb buffer displays supporting triple buffering,
we don't need the entire async page flip handling logic anymore.

In the future we could turn wait_for_page_flip() into an async fn.
2025-01-08 21:46:25 +01:00
Simon Hausmann
953d8a49fe Implement triple-buffering for the DRM dumb buffer display 2025-01-08 21:46:25 +01:00
Simon Hausmann
82c72d4d26 LinuxKMS: Enable triple-buffering when rendering with gbm
cc #6951
2025-01-08 21:46:25 +01:00
Olivier Goffart
6b4c822a4a MenuBar: C++/Rust native menubar implementation
introduce a SetupMenuBar builtin function to ease C++/Rust lowering
2025-01-08 21:16:17 +01:00
Olivier Goffart
71e331995c Don't depend on muda on Linux 2025-01-08 14:05:35 +01:00
Olivier Goffart
846664ad45 WIP: native menubar using muda
Only the interpreter is implemented so far

MacOs won't work yet because we don't disable the default winit menubar

The viewer don't support removing the MenuBar yet
2025-01-08 14:05:35 +01:00
Arnold Loubriat
49196728a7 Add AccessibleRole::GroupBox 2025-01-07 23:08:03 +01:00
Arnold Loubriat
e225ac15e0 Map the visible property to the AccessKit Node::hidden property 2025-01-06 09:30:11 +01:00
Arnold Loubriat
3304df0f82 Add AccessibleRole::TabPanel 2025-01-06 09:30:11 +01:00
Simon Hausmann
c31389dd14 AccessKit: expose popups in the accessibility tree
This is the plumbing, where a `PopupWindow` directly becomes a child of wherever it's declared in, when show() is called. Further changes may be necessary to make this really useful, such as new roles or improved dialog handling. (see ticket for comments)

Fixes #7209
2025-01-03 12:59:31 +01:00
Simon Hausmann
30ae161d51 AccessKit: Clean up internal helper function
accessible_parent_for_item_rc does not depend on NodeCollection.
2025-01-03 12:59:31 +01:00
Simon Hausmann
1320a839da AccessKit: simplify item to node id encoding API
Implicitly register the component if not found. This makes the API easier to use. In another patch I called encode_item_node_id() in some other place before the component happened to be registered, and then it would return
None and each call site would then register the same pre-registration as in build_node_for_item_recursively.
2025-01-03 12:59:31 +01:00
wu bobo
a60c3b39b9
Fixed text input on Android, fixed for older Android versions (#7204)
* Fixes for older Android versions (6.0 to 9.0)

* Fix build script for Android (#4920)

* Fix clipboard operations on Android

* Fix TextEdit crashing on Android (#7203)

* Remove unsafe calls added in 'Fixes for older Android versions'

* Update a comment in androidwindowadapter.rs

Fixes #7182
2025-01-03 11:18:33 +01:00
U-ALDEBERAN\Nate
cfc52c3fa6 ChangeLog: Creating an API to enable creating winit Windows with Slint's event loop
In `winit`, it is not possible to instantiate a new window without access to the `winit` event loop, which Slint manages.  With this change, there is now a `create_winit_window` call on Slint's winit` back end that will enable creating `winit` windows using existing functionality.

Of course, the utility of these windows is limited without access to `winit` event handling, but there are applications for which simply creating a window and instructing an external program to write into it (by passing the `HWND` on Windows or the `XId` on X11) is useful.
2025-01-02 13:32:47 +01:00
Olivier Goffart
b2b3bf800a
winit: Fix docs generation on docs.rs/i-slint-backend-winit 2024-12-30 11:00:29 +01:00
Simon Hausmann
16ec61f922 Fix build with merely renderer-software enabled for the winit backend
Fixes #7160
2024-12-19 09:05:46 +01:00
Simon Hausmann
1c5c9db181 From the BackendSelector API, link to the backends and renderer chapter in the docs 2024-12-18 09:34:03 +01:00
Simon Hausmann
dc4bda958e Fix window decoration on Linux with Wayland not being rendered according to the selected color scheme 2024-12-17 16:48:38 +01:00
Simon Hausmann
e69bbef5e6 On Linux, react to dark/light color scheme changes 2024-12-17 16:06:21 +01:00
Simon Hausmann
6c60f9b2a5 Use ashpd to detect dark/light mode on Linux.
The previously used dark-light crate is going to switch to ashpd, so we
might as well use it directly. This is using an older version to match the
zbus version used with accesskit.

This could be extended in the future to use spawn_local and use the stream
provided by ashpd to listen to theme changes.

Fixes #4392
2024-12-17 16:06:21 +01:00