Commit graph

1488 commits

Author SHA1 Message Date
FloVanGH
dcb7c065d6 menu: cosmic style 2025-02-25 16:31:31 +01:00
FloVanGH
5019ff7df4
menu: adjusted for material style (#7731) 2025-02-25 07:25:31 +00:00
Olivier Goffart
11accc190a Fix panic when inlining into clip during the second phase of inlining
During the second phase, anything that involve @children should already
have been processed, so there shouldn't be anything left to inline.
But the children insertion point may be pointing to the wrong location
if some items were moved around (eg because of the `clip`).
So work it around by not accessing the children array at that indax that
might be out of range.

Fixes #7724
2025-02-24 19:15:39 +01:00
Simon Hausmann
dde0ebe201 Fix build for C++ generated code for embedded textures 2025-02-24 17:02:10 +01:00
Simon Hausmann
df6c99871d Change TargetPixelBuffer's draw_texture function to take a data structure instead of many arguments 2025-02-24 17:02:10 +01:00
FloVanGH
be7c125726
menus: fluent style and refactoring (#7723)
* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-24 17:01:22 +01:00
Olivier Goffart
fe333049ea Fix Menu highlight on hover
Regressed in 5cccfda36f
2025-02-24 09:37:37 +01:00
FloVanGH
5cccfda36f
menu: cleanup code, extract MenuItemImpl (#7696)
* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-22 08:10:54 +01:00
Olivier Goffart
1a2aff8b57
Revert "compiler: inline components that are used only once" (#7697)
This reverts commit bf716ff8c5.
(And also revert the test part of 259756c0fd)

This exposed the bug #7693 and more issues mentined in
https://github.com/slint-ui/slint/issues/7693#issuecomment-2675077008

Fixes #7693
CC #7680
2025-02-21 19:11:11 +01:00
Olivier Goffart
39191e5acd
Menu API changes
`ContextMenu` -> `ContextMenuArea`

`ContextMenu` must have a `Menu` child.
`MenuItem` can no longer be put dirrectly in `MenuBar` and can no longer
have children
`Menu` is used now for sub menus
2025-02-21 16:03:47 +01:00
Alex Badics
337282373f compiler: add more complicated const propagation unit test 2025-02-21 11:16:00 +01:00
Alex Badics
7128097b94 compiler: add handling for < and > in const propagation 2025-02-21 11:16:00 +01:00
Alex Badics
d173fa0ba9 compiler: Fix function constness marking 2025-02-21 11:16:00 +01:00
Alex Badics
848e54a9ac compiler: fix func constness propagation 2025-02-21 11:16:00 +01:00
Alex Badics
61df727c48 compiler: fix materialize_fake_properties change 2025-02-21 11:16:00 +01:00
Alex Badics
3e67c93097 compiler: fix pretty print crash on wrong parent references 2025-02-21 11:16:00 +01:00
Alex Badics
68dd67244b compiler: emit optimized fake properties for Images 2025-02-21 11:16:00 +01:00
Alex Badics
bf716ff8c5 compiler: inline components that are used only once 2025-02-21 11:16:00 +01:00
Alex Badics
259756c0fd compiler: don't inline repeater components
They don't need to be inlined, and a lot of the times inlining them incur
a significant overhead (e.g. in case of conditional complex components)
2025-02-21 11:16:00 +01:00
Alex Badics
65bcca1082 compiler: inline functions if possible 2025-02-21 11:16:00 +01:00
Alex Badics
38ddb4d2b7 compiler: improve return elimination 2025-02-21 11:16:00 +01:00
Alex Badics
c2e9fa9f66 compiler: enhance const propagation 2025-02-21 11:16:00 +01:00
Simon Hausmann
368ec3459b
Improve default accessibility of TextInput elements
Apply similar logic as to LineEdit and TextEdit, so that when folks build their own text input widgets, they're accessible by default. Also fixed the docs while at it to mention default applications.

Amends #7669
2025-02-20 13:44:16 +01:00
Olivier Goffart
1e814c9bdc
Stabilize the sdf-fonts feature
Enable the SDF feature by default in our compiler binaries

(Still disabled by default for other users because it takes up compile
time for something they probably don't need)
2025-02-19 21:24:53 +01:00
Arnold Loubriat
cc91de2d38 Add the accessible-read-only property 2025-02-19 09:16:41 +01:00
Arnold Loubriat
90c337f1d1
Add AccessibleRole::Image and use it in the AboutSlint widget (#7593)
* Add `AccessibleRole::Image`

* Improve accessibility of the `AboutSlint` widget

* Filter out some images from the accessibility tree
2025-02-18 09:43:53 +01:00
Olivier Goffart
7c75720c9a Compiler: remove more indeterminism in the order of statements 2025-02-15 18:53:44 +01:00
Olivier Goffart
b2e7b0ec7d compiler: Use BTreeMap at a few more place to help with determinism of the output
CC #7642
2025-02-15 18:53:44 +01:00
Simon Hausmann
fc26666a0e Attempt to provide better diagnostics when the translation bundle directory path can't be read 2025-02-11 19:26:37 +01:00
Olivier Goffart
c85b20d431 ContextMenu on the LineEdit and TextEdit
With usual copy/paste entries

We need to make sure that showing the popup window don't clear the
selection in the TextInput which happens if the TextInput gets a
FocusOut event.
2025-02-11 10:30:11 +01:00
Olivier Goffart
2e4353d3c9 Implement closing of popup menus 2025-02-10 20:27:43 +01:00
Olivier Goffart
aa234c2a6e Material SpinBox: Fix binding loop in some layout
Having the width depending on the height is asking for trouble because
usually it is the height that depends on the width, so if the SpinBox is
getting in a complex layout, it causes a binding loop.
Workaround the problem by using the computed height.

This should fix the gallery build with the material style
(which is currently making the nightly build fail)
2025-02-09 16:31:40 +01:00
Yuri Astrakhan
2567880db8 Fix clippy::empty_line_after_doc_comments 2025-02-08 11:39:18 +01:00
Olivier Goffart
9853384f56
CombBox: Don't change on scroll unless we have focus / not at all on cupertino
* ComboBox: Don't change on scroll uless we have focus

This is what native Windows combobox does.
Otherwise this causes problem when combobox are in scrollable

Fixes #5929

* ComboBox: Don't scroll at all with the wheel on Mac.

This is also Qt's behavior
https://doc.qt.io/qt-6/qstyle.html#:~:text=SH_ComboBox_AllowWheelScrolling
2025-02-07 13:52:14 +01:00
Olivier Goffart
c0b72cad2f
ContextMenu: show submenu on hover after a timeout
This means that the parent menu still get the mouse events

Also add the ability to close the menu programmatically
2025-02-07 13:27:32 +01:00
Yuri Astrakhan
feb7a864df Auto-fixed clippy::useless_format
See https://rust-lang.github.io/rust-clippy/master/index.html#useless_format

```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::useless_format

cargo fmt --all
```

`__CARGO_FIX_YOLO=1` is a hack, but it does help a lot with the tedious fixes where the result is fairly clear.
2025-02-07 13:16:50 +01:00
Olivier Goffart
7104c6e88e
Rudimentary key navigation of the popup menu (#7556)
Closing the menus is still not implemented
2025-02-07 10:01:40 +01:00
Yuri Astrakhan
05f4fc0cde Auto-fixed clippy::needless_return
`__CARGO_FIX_YOLO=1` is a hack, but it does help a lot with the tedious fixes where the result is fairly clear.

See https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::needless_return

cargo fmt --all
```
2025-02-07 09:46:49 +01:00
Yuri Astrakhan
9621cae218 Auto-fixed clippy::needless_lifetimes
`__CARGO_FIX_YOLO=1` is a hack, but it does help a lot with the tedious fixes where the result is fairly clear.

See https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes

```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::needless_lifetimes

cargo fmt --all
```
2025-02-07 09:20:49 +01:00
Yuri Astrakhan
6324b35e94 Auto-fixed clippy::needless_borrow
`__CARGO_FIX_YOLO=1` is a hack, but it does help a lot with the tedious fixes where the result is fairly clear.

See https://rust-lang.github.io/rust-clippy/master/index.html#/needless_borrow

```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::needless_borrow

cargo fmt --all
```
2025-02-07 09:02:45 +01:00
Yuri Astrakhan
bcb2953f00 Auto-fixed clippy::unnecessary_map_or
This is a hacky approach, but does help a lot with the tedious fixes.

See https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_map_or

```
__CARGO_FIX_YOLO=1 cargo clippy --fix  --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::unnecessary_map_or

cargo fmt --all
```
2025-02-07 09:02:31 +01:00
Yuri Astrakhan
4ae2627ade A few more format arg inlining
Used these commands and some manual searching

```
cargo clippy --fix  --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::uninlined_format_args
cargo clippy --all-targets -- -A clippy::all -W clippy::uninlined_format_args
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2025-02-07 06:43:19 +01:00
Yuri Astrakhan
5356fdcf89 Fix clippy issues, plus a few manual cleanups
* Run `cargo clippy --fix`
*  `BackendSelector` is easier to instantiate with auto `Default`
2025-02-06 17:28:51 +01:00
Olivier Goffart
2846c35055
TextInput: implement page up/down
CC #474
2025-02-06 14:52:28 +01:00
Yuri Astrakhan
61de4d56b0 Fix all format arg inlining
Ran this command:

```shell
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2025-02-06 10:16:20 +01:00
FloVanGH
2f03bad1cc
added missing properties to StandardTableView (#7543) 2025-02-05 10:02:22 +00:00
Olivier Goffart
88cc96ba73
Make forward-focus in a PopupWindow work 2025-02-04 12:31:06 +01:00
Arnold Loubriat
358e42a8d5 Add the accessible-action-expand action 2025-02-03 20:32:45 +01:00
Arnold Loubriat
79b4950f41 Remove combo box's inner label from the accessibility tree 2025-02-03 20:32:45 +01:00
Arnold Loubriat
f30f953ffd Add the accessible-expanded property 2025-02-03 20:32:45 +01:00