Commit graph

1458 commits

Author SHA1 Message Date
Olivier Goffart
387e4202ea Rust: one more fix for computations on big numbers 2025-01-20 16:47:49 +01:00
Olivier Goffart
90f5621985 Fix string formatting of big integer
Don't lower the precision to f32 for big enough numbers
2025-01-20 15:55:44 +01:00
Olivier Goffart
de80bb0a2c Rust: Fix comparison of big integers
Don't convert integer to f32 in the rust generated code
2025-01-20 15:55:44 +01:00
Olivier Goffart
0dc068524c Fix panic in the compiler when having a changed callback over a property that is not materlialized
Fixes #7316
2025-01-17 12:19:20 +01:00
Olivier Goffart
28e54175f6 Work on the ContextMenu
- Add the `entries` property in the ContextMenu
 - Make right click on the ContextMenu show the menu
 - Use the proper technique to register ContextMenu and MenuBar as
   experimental (same as ComponentContainer)
2025-01-16 20:21:06 +01:00
Olivier Goffart
f72e8a1c01 C++/Interpreter: Be consistant with rust in the order in which we create the window
Same as previous commit for Rust
2025-01-16 19:11:31 +01:00
Olivier Goffart
9d1be5209c Don't panic in the generated rust ComponentHandle::window()
It can panic if lazily constructing the window adapter.
Make sure it is actially not lasily constructed, we don't need lazy constructor when not embedding anyway.
2025-01-16 19:11:31 +01:00
Tasuku Suzuki
68b9dfc247 String: Add .is-empty and .character-count properties
Introduce two new properties for string in .slint:
- .is-empty: Checks if a string is empty.
- .character-count: Retrieves the number of grapheme clusters
  https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries

These additions enhance functionality and improve convenience when working with string properties.
2025-01-14 19:29:05 +01:00
Olivier Goffart
8a5df27469
Update to Image 0.25 (#7365)
Added image-default-formats with all the format supported by image by
default, and enable that feature by default.
Also put that feature in compat-1-2 for compatibility with user that
have used image 0.24 with enabled features.
Make a new compat-1-10 feature that does not enable default format by
default

ChangeLog: upgraded image crate to 0.25, added a new cargo feature
to enable all image formats. (that feature is enabled by default with
compat-1-2, added compat-1-10 to disable it

Fixes https://github.com/slint-ui/slint/issues/7251
2025-01-14 16:31:05 +01:00
Simon Hausmann
53f2d572b1 Remove some uses of once_cell 2025-01-14 14:18:24 +01:00
Olivier Goffart
5cf9c6806e LSP: don't auto-compete private properties 2025-01-14 11:26:57 +01:00
Olivier Goffart
7056515f6c Detect binding loops when it involve the condition of a if in a layout
Fixes #7126
2025-01-13 14:40:18 +01:00
ogoffart
c83af3ca5c Bump version number to 1.10.0 2025-01-13 13:38:41 +00:00
Tasuku Suzuki
346d1c2df3 Fix typos
Ran `typos .` and fixed all typos that do make sense.
https://crates.io/crates/typos
2025-01-13 08:35:20 +01:00
Simon Hausmann
aa332202c5 Rename AccessibleRole.GroupBox to AccessibleRole.Groupbox
While unfortunate in casing, this is consistent with Checkbox, Combobox, and Spinbox.
2025-01-10 16:27:14 +01:00
Olivier Goffart
3e94bd2167 Janitor: Remove trailing whitespaces from all files
`git grep -I -l -O'sed -i "s/[[:space:]]*$//"' -e ''`
2025-01-10 13:23:22 +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
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
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
Olivier Goffart
9685af865a MenuBar: error when MenuBar is repeated or conditional 2025-01-08 11:00:59 +01:00
Arnold Loubriat
f7b9da96d4 Set accessible-enabled on group box widgets 2025-01-07 23:08:03 +01:00
Arnold Loubriat
8b95752de7 Set accessible-label on group box widgets 2025-01-07 23:08:03 +01:00
Arnold Loubriat
49196728a7 Add AccessibleRole::GroupBox 2025-01-07 23:08:03 +01:00
Olivier Goffart
863a6fdebb Fix panic when inlining 0 children in a Row
The first inlining pass should inline any element that has children.
Row is going to be optimized out before the second inlining pass.
In that pass, we shouldn't care if there is no children while inlining
in a `@children`

Fixes #7284
2025-01-07 18:40:38 +01:00
Tobias Hunger
cfb2324526 lsp: Rename structs and enums
... but only when directly on the name of the struct
when it is declared.
2025-01-07 16:18:46 +01:00
Olivier Goffart
aedd04a3d8 Parser: skip UTF-8 BOM
Skip the byte order mark.
BOM is also allowed in .rs or Cargo.toml file.

Fixes #7291
2025-01-07 12:34:08 +01:00
Olivier Goffart
a942ed0852 Remove thiserror dependency
Uses derive_more instead
2025-01-06 17:25:08 +01:00
Olivier Goffart
58242676f6 Janitor: Update rowan dependency 2025-01-06 17:25:08 +01:00
Olivier Goffart
76332c5e16 Improve a bit the error when the base of an element is missing 2025-01-06 10:47:05 +01:00
Arnold Loubriat
9c25040b00 Set accessible-action-default on tabs 2025-01-06 09:30:11 +01:00
Arnold Loubriat
14466d1be6 Set accessible-label on tab panels 2025-01-06 09:30:11 +01:00
Arnold Loubriat
3304df0f82 Add AccessibleRole::TabPanel 2025-01-06 09:30:11 +01:00
Arnold Loubriat
60aacc8f82 Set accessible-item-selected on tabs 2025-01-06 09:30:11 +01:00
Arnold Loubriat
67f6e1a737 Set accessible-item-selectable on tabs 2025-01-06 09:30:11 +01:00
Arnold Loubriat
23e37ce4de Set accessible-item-index on tabs 2025-01-06 09:30:11 +01:00
Arnold Loubriat
38499962a9 Set accessible-item-count on tab bar widgets 2025-01-06 09:30:11 +01:00
Arnold Loubriat
c3cfa6044a Remove tab title label from the accessibility tree 2025-01-06 09:30:11 +01:00
Simon Hausmann
3bff12f092 Make i-slint-compiler widget library inclusion Bazel sandbox friendly
The cargo manifest path differs between the invocation of build.rs and rustc when compiling included_library.rs. Accomodate this by providing relative paths.
2025-01-04 12:48:10 +01:00
Simon Hausmann
251bf2332c Partial fix for bazel build when packaging the widgets library during i-slint-compiler build
When the build script runs within a sandbox, all files are symlinked. So checking for say widgets/fluent/button.slint to be a file with is_file() fails, because it's a symlink. Use !is_dir() instead.
2025-01-04 12:48:10 +01:00
Simon Hausmann
d0232782e0 Fix typo 2025-01-03 17:04:27 +01:00
Olivier Goffart
12c99f1c80 Add a warning when a component/type name overwrite another
Also fix the unused component warning when that happens
Fixes #7176

ChangeLog: Warning when a type name overwrite another
2025-01-03 09:29:27 +01:00
Olivier Goffart
3ea8be06e8
Make StandardButton focusable
Fixes #7230

ChangleLog: Fixed StandardButton not focusable
2024-12-30 13:33:15 +01:00
ogoffart
f309a551b5 Bump version number to 1.9.2 2024-12-30 10:18:16 +00:00
Tasuku Suzuki
bc89c634b3 Fix warning message for a property that name is used for function 2024-12-26 17:54:38 +01:00
Tasuku Suzuki
7a8ca9b147 Fix error message when a property named color is override
It said `Cannot override property 'background'` because color is defined
as below

```slint
property <color> color <=> background;
```

For the warning, the name should not be resolved.

Fixes #6324
2024-12-26 17:50:45 +01:00
aurindam
dc3f29b6da Bump version number to 1.9.1 2024-12-19 12:57:19 +00:00
Olivier Goffart
f31cefdea9
Fix min/max/clamp in presence of percentages
We were not properly converting the first argument

Fixes #7118
2024-12-16 18:44:55 +01:00
Olivier Goffart
60c10213d2
Remove LayoutSpec and undeprecate StyleMetrics.layout-* properties (#7069)
StyleMetrics is the right name for these
2024-12-16 14:52:28 +01:00
Olivier Goffart
4a5ba09e7a Fix panic in legacy component with out property
Fixes #7095
2024-12-16 13:58:56 +01:00