Commit graph

703 commits

Author SHA1 Message Date
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
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
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
Simon Hausmann
0d36f88152 Revamp BackendSelector API
Based on API review, PlatformBuilder becomes BackendSelector with
a slightly smaller API surface but more options, such as selecting
Metal or Vulkan rendering.
2024-12-16 13:06:05 +01:00
Benny Sjoestrand
5ef4aace4c Implement full-screen property for slint Window item
Make it possible to programatically to switch to full-screen mode
via a new property in the Windows item.
The SLINT_FULLSCREEN environment variable will default set this
property to true. However settings this property in the slint code
will override the SLINT_FULLSCREEN.

Fixes #6665
2024-12-16 09:52:40 +01:00
Simon Hausmann
bfdf0e275f Clean up Apple cfg's
Use target_vendor = "apple" where to cover all Apple OS, and exclude ios for event pumping.
2024-12-13 11:03:44 +01:00
Olivier Goffart
c0f346fdf7 Rust docs: have a macro to make link to the Slint doc 2024-12-12 16:44:31 +01:00
Olivier Goffart
a3dad45f0b Accessibility: rename a few properties after API review:
- Rename `accessible-selectable` and `accessible-selected` to `accessible-item-{selectable,selected}`.
   Because the property is for items in list rather than eg Text
 - Rename `accessible-position-in-set` to `accessible-item-index`.
 - Rename `accessible-size-of-set` to `accessible-item-count` and move
   the property to the container element rather than the item itself
2024-12-07 08:25:42 +01:00
teknalb
0f72791977
winit: Auto disable maximize button when window resize is disabled (#6997)
Fix #5565

ChangeLog: winit: Auto disable maximize button when window resize is disabled
2024-12-07 07:41:03 +01:00
Simon Hausmann
e074d05847
Fix panic in accesskit when focus change occurs before initial tree u… (#6952)
This is a prospective fix to avoid sending `tree: None` as the first tree update.

Fixes #6015
2024-12-06 10:53:28 +01:00
Olivier Goffart
6b5fc7c250 Janitor: Remove dead code 2024-12-05 15:17:04 +01:00
FloVanGH
0d1412afc5
removed skip-taskbar property from window (#6982) 2024-12-03 10:07:36 +00:00
Simon Hausmann
37f66789c5 macOS: Replace use of old apple creates with modern objc2 replacements 2024-11-28 10:00:24 +01:00
Simon Hausmann
0d7f4ecc1d Fix borrow_mut() panic in accesskit code when accesskit requests setting focus to an item
... which in turn requires a tree update with the new focus node, which requires &mut self.

Fixes #6922
2024-11-27 13:12:10 +01:00
FloVanGH
712f930897
windows: added skip_taskbar (#6911)
* Update internal/backends/winit/winitwindowadapter.rs

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update internal/backends/winit/winitwindowadapter.rs

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update docs/src/content/docs/reference/window/window.mdx

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2024-11-27 09:55:11 +00:00
Arnold Loubriat
12e7b8019d Update accesskit to 0.17 and accesskit_winit to 0.23 2024-11-24 13:36:06 +01:00
Simon Hausmann
1888e58735 Add API to set the XDG app id
ChangeLog: Added function to set the XDG app id on Wayland/X11. This needs to be added with respective function names in the language sections.

Fixes #1332
2024-11-22 11:24:06 +01:00
Simon Hausmann
05a309c86c Clean up winit window creation on startup
Create the window adapter first without a window, and then resume. This deduplicates code and means that there's now only one single place where we resume/create the renderer and
accesskit adapters.
2024-11-21 13:27:30 +01:00
Simon Hausmann
ea6e5b2841 Fix accesskit adapter lifecycle
Let the adapter live as long as we have a winit window.
2024-11-21 13:27:30 +01:00
Arnold Loubriat
97219c21bf Add the accessible-size-of-set property 2024-10-30 15:54:01 +08:00
Arnold Loubriat
67166fcc2d Add the accessible-position-in-set property 2024-10-30 15:54:01 +08:00
DataTriny
2de3b9d455 Add the accessible-enabled property 2024-10-25 10:20:09 +02:00
Simon Hausmann
7e3747041f Fix simulator build
Amends ac9b85049a
2024-10-23 19:18:57 +02:00
Ian Hattendorf
3cc44dc670 Add version to OpenGLAPI 2024-10-23 11:13:49 +02:00
Ian Hattendorf
97927ccee9 Don't allow fallback in PlatformBuilder
If we're explicitly requesting a platform with specific properties, we
should fail to allow the caller to react accordingly.
2024-10-23 11:13:49 +02:00
Ian Hattendorf
ac9b85049a Add PlatformBuilder API to allow selecting OpenGL API
Right now this just allows selecting between OpenGL and OpenGL ES.
2024-10-23 11:13:49 +02:00
DataTriny
28b5a67583 Implement accessible-delegate-focus for the AccessKit backend 2024-10-22 12:54:00 +02:00
DataTriny
be62567293 Tell AccessKit that ListItems can be focused 2024-10-21 07:13:07 +02:00
Arnold Loubriat
4621739cba Implement selectable and selected properties in the AccessKit accessibility backend 2024-10-16 15:38:46 +02:00
Tobias Hunger
df4f9b38ee femtovg: Fix warning about deprecated web_sys::set_fill_style
Use set_fill_style_str insterad, it avoids constructing a JSValue
from a str.
2024-10-16 13:25:00 +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
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
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
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