Commit graph

1507 commits

Author SHA1 Message Date
Arnold Loubriat
e17b1fda8b Properly expose Switch as such in the accessibility tree 2024-04-08 08:41:47 +02:00
notfirefox
fb2bbd8d92 Check mouse button for qt widgets in input_event 2024-04-04 09:30:01 +02:00
notfirefox
6462d699af Fix scroll direction of spinbox for qt backend 2024-04-04 09:30:01 +02:00
notfirefox
45490fca21
Implement has_hover for NativeComboBox (#5001)
Closes #5000
2024-04-02 18:20:07 +02:00
notfirefox
ab2014c42a
Implement has_hover for NativeCheckBox
Closes #4998
2024-04-02 17:41:40 +02:00
Simon Hausmann
68083243b2
Add an in-out boolean color-scheme property to Palette (#4701)
This allows applications to force dark/light mode, as well as determine
which mode is active.
2024-03-26 15:44:22 +01:00
Olivier Goffart
1f961a997b android: add the menu with cut/copy/paste when there is a selection
Also implement clipboard in the backend (Fixes #4865)
2024-03-26 14:50:55 +01:00
Olivier Goffart
8c2a798630 Android: long press select word 2024-03-26 14:50:55 +01:00
Simon Hausmann
f27c185daf
Add a released callback to Slider (#4821)
The released callback is invoked when the user finished changing the value, for example
when the arrow key is released.

As a bonus, for the Qt implementation this fixes a few bugs in the keyboard handling:
  - Handle orientation
  - Implement click-to-focus
  - Emit released also on key release

Co-authored-by: Luke D. Jones <luke@ljones.dev>
2024-03-26 14:15:52 +01:00
Olivier Goffart
2b7834e7c9 android: attempt to fix build if the locale is not UTF-8
Reported in https://fosstodon.org/@Karcsesz@equestria.social/112141146083141613

The build would fail with
```
error: unmappable character (0xC2) for encoding US-ASCII
```
Because of the © in the comment
2024-03-24 10:12:08 +01:00
Simon Hausmann
ed2816331e
Add support for raw-window-handle (#4918)
Add a `raw-window-handle-06` feature to the Rust API crates, which adds support for version 0.6 of rwh to slint::Window, by delegation adding a `window_handle()` function that returns a struct that implements the corresponding traits from rwh.

HasDisplayHandle could also be provided on the backend, but that can be
done separately if needed.

This is only implemented for the winit backend right now.

cc #877
2024-03-22 14:25:05 +01:00
Olivier Goffart
a61cf5239d Android: support for Java8
Older version of java used stderr for the version.
(As seen in https://github.com/slint-ui/slint/issues/4904#issuecomment-2014798778)
2024-03-22 14:23:10 +01:00
Olivier Goffart
fb0046c231 android: show a proper error when the version is java is too old
Also support Java 8 that did not support the --release argument yet.

Fix #4904
2024-03-22 09:20:13 +01:00
Olivier Goffart
b46effe65c Android: selection handle
Have two selection handle when there is selected text
2024-03-22 09:19:53 +01:00
Montel Laurent
fc0e8faae9
Accessibility: use tab-list for the tabwidget (#4909)
* Don't show tabwidget as tab
2024-03-21 17:48:42 +01:00
Montel Laurent
da30fa2663
Add ListView accessibility role (#4911) 2024-03-21 15:20:43 +01:00
Montel Laurent
4844b84e0c
Add Treeview accessibility support (#4907) 2024-03-21 15:18:52 +01:00
Montel Laurent
c2517008d8
Add TextInput as accessibility role (#4899) 2024-03-21 13:39:31 +01:00
Olivier Goffart
9f6b837f7d android: fix cursor and handle color
On android, the handle is the same as the cursor color and the cursor
color is usually the "accent" color.
We can't know the accent color from the native code, but we know the
selection color which is the accent color with a lesser opacity.
2024-03-20 15:06:34 +01:00
Olivier Goffart
504fbed476 android: only show cursor handle when we click 2024-03-20 12:46:10 +01:00
Olivier Goffart
528f85509b android: Moving cursor handle 2024-03-20 12:46:10 +01:00
Olivier Goffart
291a0bdc66 WIP: android cursor handle 2024-03-20 12:46:10 +01:00
Olivier Goffart
a77c8d4397 Update internal documentation of the android backend
The backend is now exposed through the Slint crate. No need to document
how to use the private API anymore
2024-03-18 13:44:14 +01:00
Tobias Hunger
28b96ca6f6 janitor: manual cargo clippy fixes
Semi-random selection of clippy topics that were
uncontroversial before:-).

Leaves about 84 deduplicated issues in the code base
according to clippy from nightly.
2024-03-14 13:42:38 +01:00
Tobias Hunger
9873cfd7c0 janitor: Run cargo clippy --fix
Only the hand-picked sensible things, not all of it ;-)

Also fix a few typos that cspell complained about when I
tried to commit and some formatting changes that cargo fmt
insisted on when commiting.
2024-03-14 13:42:38 +01:00
Olivier Goffart
b7b5b8a4dc Fix the release script
- Qt backend imples std feature of i-slint-core
 - Android backend must be published before the slint crate
2024-03-14 10:50:18 +01:00
Olivier Goffart
b7e437fb37 Qt: Fix valgrind warning "Conditional jump or move depends on uninitialised value"
The rust_window is initialized shortly after the constructor is
finished, but changeEvent can happen before that/

The warning can be shown in the log of #4803 (but that is not the cause of the bug)
2024-03-11 08:51:29 +01:00
Simon Hausmann
2b2afaf7d8 Work around gbm display not working on Vivante gbm drivers
gbm.rs' lock_front_buffer calls has_free_buffers before calling the underling C lock_front_buffer function on the gbm surface. This has_free_buffers() check succeeds the first time but always fails after that.

However apart from this check, everything else appears to be working perfectly fine. Projects like weston, ksmcube, Qt, or mutter don't do this check beforehand either, so this patch works around gbm.rs by skipping this.

Unfortunately this requires going to gbm-sys directly and implementing the drm traits that require calling the various gbm_bo_get_* functions to retrieve the buffer details for posting to DRM.
2024-02-29 15:18:14 +01:00
Olivier Goffart
318fa02226 winit: Cache locally the last value of the minimize/maximize/fullscreen state
Workaround for https://github.com/slint-ui/slint/issues/4678
Ubuntu's window manager using XWayland would raise the window when calling
set_minimized(false) even it was not minimized

Fixes #4678
2024-02-29 13:13:38 +01:00
Olivier Goffart
3969e09d5b Remove debug output 2024-02-29 11:11:59 +01:00
Olivier Goffart
c4e0f4a265 Android: support for preedit
(Tested with the typewise keyboard)
2024-02-27 18:29:36 +01:00
Olivier Goffart
1fb162936e Android: simplify the text input with SpannableStringBuilder
Also needed some change on the Text item to avoid sending ime callback
for intermediate states
2024-02-27 18:29:36 +01:00
Olivier Goffart
b8f302464c Android: fix first frame not being translated after a rotation 2024-02-26 15:51:23 +01:00
Olivier Goffart
2c5e654dd0 winit: Make sure to keep the minimized state in sync
Tested with kwin on X11 and on wayland
2024-02-26 15:51:05 +01:00
Olivier Goffart
8bc4c4e053 vtable: increase version number to account for breaking change in vtable::Dyn 2024-02-26 14:45:47 +01:00
Olivier Goffart
3910095e4d Tiling for the nine slice images 2024-02-26 12:16:41 +01:00
Olivier Goffart
5e7ddf3a19 Image Tiling
(Doesn't work yet with 9slice)
2024-02-26 12:16:41 +01:00
Simon Hausmann
9aa931f1f8 Fix C++ compiler warning
Remove name for unused QResizeEvent* parameter.
2024-02-23 14:52:31 +01:00
Ralph Minderhoud
9cb1a4a4e0
Add API for minimize/maximize on Window component (#4581)
Closes #4400
2024-02-22 10:40:36 +01:00
Olivier Goffart
440b9ce9cc winit: Remove unused function and don't depend on copypasta on wasm
Nightly Rust start warning about these.
And in the case of wasm we don't even need to depend on copypasta since
we handle the copy paste ourselves
2024-02-21 10:52:04 +01:00
Olivier Goffart
7b2ff89f1c Fix nightly warnings
eg:
```
warning: the item `Box` is imported redundantly
```
2024-02-21 10:52:04 +01:00
Olivier Goffart
bb4f2b1581 Implement 9slice with other renderer 2024-02-13 14:46:27 +01:00
Olivier Goffart
ce6c7f5527 Image: add horizontal and vertical alignment 2024-02-08 18:59:26 +01:00
Olivier Goffart
cb92ba1132 Add ImageFit.preserve and de-duplicate the fitting code 2024-02-08 10:10:56 +01:00
Olivier Goffart
c6180765fc Qt: Fix drawing of rectangle with border == width
If border-width == with or height of the rectangle we're trying to draw,
we will end up drawing an empty rectangle as we substract border-width/2
from both sides.
Rectangle with border-width bigger than half the size of the rectangle
don't make sense anyway, as it is fully covered by the border. So limit
the size of the border to half the size of the rectangle
2024-02-08 10:07:29 +01:00
Olivier Goffart
af8075d1b2 Only enable the Qt backend by default on Linux
The trick is that the backend selector build by default with the
i-slint-backend-qt, but the "enable" feature is only enabled if the
qt-backend feature is enabled explicitly, or on linux from the slint
or slint-interpreter crate
2024-02-07 15:20:03 +01:00
Olivier Goffart
b23c605ac1
Refactoring: Use a trait for Item being Images 2024-02-07 13:28:47 +01:00
Simon Hausmann
367af4fdf4 Align rotation between software renderer and LinuxKMS backend
As discussed a few days ago, let's define rotation to be always
clockwise, as it is done in other graphics frameworks as well as our
own image rotation. This means changing the definition for the
software renderer. Also fixed docs for the enum in the linuxkms backend
that was wrong.
2024-02-07 11:21:59 +01:00
J-P Nurmi
cc5d2b24e5 Add BasicBorderRectangle to avoid unnecessary xxx-border-radius bindings 2024-02-06 18:01:35 +01:00
J-P Nurmi
031742246c Implement clipping 2024-02-06 18:01:35 +01:00