Commit graph

441 commits

Author SHA1 Message Date
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
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
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
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
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
J-P Nurmi
f8ed10b092 Qt: non-uniform border radius 2024-02-06 18:01:35 +01:00
Olivier Goffart
41f1f41536 Qt: fix crash when closing the popup window on wayland
Fixes #4500

When the WindowAdaptor is dropped, deleteLater is used on the C++ QWidget.
On wayland, we still recieve a mouse exit event when the widget is about
to be deleted. This calls a callback into the deleted Rust WindowAdaptor.
2024-02-01 09:31:08 +01:00
Olivier Goffart
f1f141896f
Fix linear gradiant rendering in non square rectangle
Fixes https://github.com/slint-ui/slint/issues/3730
2024-01-17 17:44:51 +01:00
Olivier Goffart
afb8a66603 Qt backend: Check if platform supports the selection clipboard
Suppress console warning on Windows:
`Data set on unsupported clipboard mode. QMimeData object will be
deleted.`

Fixes #3206
2024-01-10 10:11:05 +01:00
Simon Hausmann
438b9afeaa
Reduce WindowAdapter API slightly (#4304)
Move the set_fullscreen function added to the WindowAdapter trait in 779aff0b39
to be a function in WindowProperties instead.
That way it'll be easier in the future to extend this with other window states without
having to modify or break the WindowAdapter trait API.
2024-01-09 18:55:06 +01:00
Harold
779aff0b39
Added set_fullscreen API to WindowAdapter. (#4286)
See #3283
2024-01-09 15:23:23 +01:00
Olivier Goffart
9ff13faee8 Implement the quitting on windows close in i-slint-core and not in the platform
Step towards #1499
2024-01-08 21:17:52 +01:00
Simon Hausmann
c5aebcfde3 Fix close behaviour of PopupWindow
- Close on release when the mouse pointer is inside the popup
- Close on press when click is outside
2024-01-06 10:45:34 +01:00
Noah Sweilem
4ca5afc710
Implement colorize-icon for NativeButton (#4167)
Fixes #4159.

Co-authored-by: Florian Blasius <florian.blasius@slint.dev>
2023-12-18 09:19:09 +01:00
Noah Sweilem
1ddddf1081
Qt backend: use QObject::deleteLater() when destroying popup QWidget (#4168) 2023-12-18 09:03:39 +01:00
Florian Blasius
e587c09d9c
Added colorize-icon to Button (#4152)
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2023-12-14 12:07:55 +01:00
Florian Blasius
6da8120dfa
added palette global (#3984)
* Update docs/reference/src/language/builtins/globals.md

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

* Update docs/reference/src/language/builtins/globals.md

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

* Update docs/reference/src/language/builtins/globals.md

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

* Update docs/reference/src/language/builtins/globals.md

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

* Update docs/reference/src/language/builtins/globals.md

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


---------

Co-authored-by: Florian Blasius <florian.blasius@slint-ui.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
Co-authored-by: Florian Blasius <flovansl@fedora.fritz.box>
2023-12-11 14:44:05 +00:00
Florian Blasius
6d6b18300a
added focus state to StandardLIstView (#4086)
* added focus state to StandardLIstView

* (wip) focus handling for qt style

* Update CHANGELOG.md

Co-authored-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>

* Share StandardListView between all styles

* Update internal/compiler/widgets/material-base/combobox.slint

Co-authored-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>

* code review feedback

---------

Co-authored-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
2023-12-08 10:58:58 +01:00
Simon Hausmann
19f6840452 Remove now unused Qt license files 2023-12-01 14:48:07 +01:00
Jocelyn Turcotte
82916bc2ec Implement KeyEvent.repeat
Now that winit was upgraded do 0.29 we can use its KeyEvent::repeat field.
Also feed Qt's QKeyEvent::isAutoRepeat() in the Qt backend.
2023-11-29 09:31:31 +01:00
Simon Hausmann
a5c3692fbc Add progress-indicator accessible role 2023-11-07 13:37:12 +01:00
Simon Hausmann
7b61e455eb Initial implementation of a Slint event loop sitting on top of Node.js
At the moment this is implemented using polling.

cc #2477
2023-11-06 11:37:45 +01:00
Olivier Goffart
f24014a2dd Refactor the internal IME event
Base the info on what's discussed in #3811
but this is just the internal event and not the public API
2023-11-02 12:16:40 +01:00
Olivier Goffart
1efd83621d Refactor: Merge KeyInputEvent and KeyEvent
Both structure are bascially the same and only used internally, no need
to have the two.

The only difference was that one had the modifiers and the other one
not. But we can just set the modifier at the point we were converting
between the two.
2023-11-02 12:16:40 +01:00
Olivier Goffart
bebec49398 Refactor input_method_request
Part of #3811

But this is still on the internal trait for now
2023-11-02 12:16:40 +01:00
Thorbjørn Lindeijer
081e7fe456 Qt: Fix executable name passed to QApplication
The name passed was always "Slint", which can show up in the task
switcher, as seen on Linux/Xfce. Instead, we now use std::env::args() to
pass the actual first argument.

I think ideally this should use std::env::args_os() since we don't need
the data to be valid unicode (in which case this will panic). However,
stable Rust does not appear to provide a way to get at the bytes of an
OsString.
2023-10-25 16:58:28 +02:00
Tobias Hunger
49571c8bf2 qt: Silence warning during Slint build
Silence this warning:

```
warning: i-slint-backend-qt@1.3.0: qt_window.rs:1536:17: warning: ignoring temporary created by a constructor declared with 'nodiscard' attribute [-Wunused-value]
```
2023-10-23 16:52:42 +02:00
Olivier Goffart
12cd8e71f1 WIP: some polish over the winit update to 0.29 2023-10-23 14:22:48 +02:00
Florian Blasius
030cf2cd19
Update scroll offset on ScrollView on ScrollBar scroll-event (#3668) 2023-10-16 10:41:39 +02:00
Tobias Hunger
b12575a4c4 janitor: Go over our spell checking setup
* Extend the cspell word list
* Remove those extensions from individual source files
* white-list licenses and such as we should not meddle with those
* Fix spelling
2023-10-16 09:01:51 +02:00
Florian Blasius
e83f3c8068
Added SpinBoxBase, use scroll-event to change value. (#3665) 2023-10-13 13:37:20 +02:00
Olivier Goffart
852b4d906d Rename ComponentVTable to ItemTreeVTable
and their related name.
Also move the component module in the item_Tree module
register_component -> register_item_tree
ComponentItemTree -> ItemTreeNodeArray

For #3323

Rationale from that issue:

Right now, we use the term `component` in the Slint language and in the compiler to be a a tree of elements that can be used as an element in a .slint file.

The term is also currently used in the runtime as a tree of runtime Items that are allocated together. (declared in ComponentVTable)

But there are no 1 to 1 mapping between a `component` in the slint language, and a runtime Component.
(for example, the items behind a `if` or `for` or `PopupMenu` are in a different runtime component. And `component` declared in Slint are often inlined)

So we should rename the internal runtime `Component` to  `ItemTree`

The currently public `slint::ComponentHandle` wraps the "root" of the ItemTree, but that's ok because it is generated from a .slint `component`,  so it doesn't change name
2023-10-09 11:01:56 +02:00
Tobias Hunger
85e1c6020b janitor: Use workspace dependnecies for the slint crates
This moves most of the version information we need to update into one
place.

Note that the workplace dependency features are in *addition* to any
feature set when using the workspace dependency. So we have all
workspace dependencies defined with `no-default-features = true`.
2023-09-25 16:34:16 +02:00
Tobias Hunger
d6695c55cb Janitor: Use cargo workspace package data more 2023-09-25 16:34:16 +02:00
Olivier Goffart
0b4bfd3a40 Qt style: Fix GroupBox not being clipped
Fixes #3541
2023-09-25 12:35:41 +02:00
Olivier Goffart
9466819421 Qt style: fix enabled state in some widgets 2023-09-25 10:48:51 +02:00
Olivier Goffart
d3ed4dfad0 Qt Widgets: set the preferred-size to the minimum-size
Instead of setting it to 0 which cause `widget.preferred-width` ti be 0

Fixes #3527
2023-09-22 14:31:46 +02:00