Commit graph

1507 commits

Author SHA1 Message Date
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
Simon Hausmann
10413c555e doc: remove BackendSelector::doc_internal from public API 2024-12-17 10:11:58 +01:00
Simon Hausmann
9ff1d88602 Implement Drop for BackendSelector to select the backend 2024-12-16 13:06:05 +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
Nigel Breslaw
92534a8a27
1.9 Organise docs folder. (#7005)
Move astro files to docs/astro
2024-12-05 15:40:04 +02:00
asuper0
387220227d
Add step property to Slider (#6981)
Closes #4549

ChangedLog: Slider: added `step` property
2024-12-05 11:50:08 +01:00
Nigel Breslaw
4c1ececc67
1.9 docs: Flesh out docs guide 2024-12-05 00:19:37 +02:00
FloVanGH
0d1412afc5
removed skip-taskbar property from window (#6982) 2024-12-03 10:07:36 +00:00
FloVanGH
901afde11f
api review: callback parameters and properties name adjustements 2024-12-02 16:22:39 +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
Simon Hausmann
3f8084cdc0 When using Skia with softbuffer and partial rendering, report damages to softbuffer
Co-Authored-By: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-19 21:31:04 +01:00
Simon Hausmann
9b7de3f806 Pass the buffer age to the Skia software renderer 2024-11-19 21:31:04 +01:00
FloVanGH
5ea05e18af
std-widgets: added horizontal-alignment to SpinBox (#6778) 2024-11-15 08:05:57 +00:00
Olivier Goffart
14adc2af2f Silence a warning in Qt headers 2024-11-04 20:45:04 +01:00