Commit graph

30 commits

Author SHA1 Message Date
Olivier Goffart
db18f4e2e5 Change the new error that detects binding loop through the window into a warning
In 80de96488a (#3397) we introduced a new
error if we detect a binding loop from the Window geomerty to its layout.
But it looks like this causes a lot of error in existing project, so
make it a warning instead.

It will continue to be an error in the live preview as this will cause a
panic otherwise.

This commit also change the text of the error to include the actual
binding loop. I hope this makes it easier for users to see the loop and
help to fix it.
2025-06-02 19:01:47 +02:00
Olivier Goffart
12393e21bd
syntax_tests: allow to update tests, and don't use a regexp (#8589)
* syntax_tests: allow to "bless" tests, and don't use a regexp

A regexp was used at the beginning because I thought we would want to
allow error to contains things that were not predictable or that would
often change. But this is not the case¹. It is better to actually test
for the full error message

¹ well actually it was the case for path, but there is another substitution to 
 `📂` for the manifest directory

* syntax_tests: Bless the tests

* syntax_tests: Manual adjust after bless

Because there used to be comments on the same line of the message which
bless don't support

* Fix error message with path on windows

 - The debug implementation of path make double slash, that's not what
   we want to show the user
 - normalize paths to use `/` so the test passes
2025-06-02 16:47:33 +02:00
Olivier Goffart
80de96488a Detect binding loops that applies to the Window itself
The Window geometry depends on its constraints, so its constraints
cannot depends on its geometry

This fixes Infinitely growing layout, and other panics

Fixes #3989
Fixes #2902
Fixes #8065
2025-05-21 10:33:02 +02: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
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
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
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
Olivier Goffart
6b3361d079 Properly report binding loop involing font-metrics 2024-12-10 21:26:58 +01:00
Aurindam Jana
3523e86359
Simplify commercial license (#3063)
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
2024-05-31 14:06:17 +02:00
Aurindam Jana
9a3aa265d5
Update Royalty-free license (#5257)
Add clarification that Application may not expose Slint APIs.
2024-05-31 10:53:19 +02:00
Aurindam Jana
0cfeec1a31
Update Slint Community License (#4994)
Updated the version from 1.1 to 1.2 
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
2024-04-15 15:18:55 +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
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
Simon Hausmann
016d776b7d Simplify implementation of absolute-position
Since we materialize only one point property, we don't need to cache the
parent position in a separate property, but we can just store that in
the binding.
2023-06-21 10:02:04 +02:00
Simon Hausmann
ab0e38c76d
Merge absolute-x and absolute-y "virtual" properties into absolute-position (#2942)
The type of thep property is `Point`, which existed before. It was
mapped to `slint::private_unstable_api::re_exports::Point` (euclid) and
is now mapped to slint::LogicalPosition (also in C++).
2023-06-21 08:17:57 +02:00
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Tobias Hunger
04d1229685 Fix licnese information using xtask 2023-06-16 09:14:20 +02:00
Aurindam Jana
039e54a5de
Add royalty free license to files except examples and docs (#2888) 2023-06-15 11:20:50 +02:00
Simon Hausmann
1bf05eae7c
Add support for absolute-x and absolute-y properties on any element (#2823)
Fixes #1691
2023-06-06 14:37:53 +02:00
Tobias Hunger
bbdd6aeab7 compiler: Ignore leading whitespace when parsing
... and update all out test cases accordingly.
2023-04-26 17:22:13 +02:00
Olivier Goffart
1089d29ebb Make Empty not fill the parent by default
Unless `preferred-*:100%` is set

Part of #2284
2023-03-24 11:15:05 +01:00
Olivier Goffart
ee672d65f5 Fix panic when the binding loop is caused by accessing the same component twice
The component properties might be accessed through different paths so we
may still reach a case where we have to borrow something that is already
borrowed
2023-01-24 18:01:30 +01:00
Simon Hausmann
24dcef5fed
First stage of cleaning up the export handling of the slint root component (#2095)
We implicitly export the last component of a .slint file to the generator.
Issue a warning when that happens and suggest to export it explicitly.
2023-01-23 15:19:49 +01:00
Olivier Goffart
1cbd61145e WIP: pure qualifier for callback and functions 2022-12-22 00:26:27 -08:00
Olivier Goffart
3c5aeb5897 Test for binding loops involving functions 2022-12-06 14:56:25 +01:00
Olivier Goffart
d18ed9f799 Fix panic when doing binding analysis of properties in repeater in layout
Given an element in a layout, we must visit the properties in the
repeated component, not the dummy repeated element.
2022-10-18 10:11:40 +02:00
Olivier Goffart
57d61475b3 Detect loop on the property itself
This is the most basic loop and we wouldn't show a signal.

Turn out the comment was wrong and we do not seem to emit the error
twice for two ways binding to itself

Fixes #1407
2022-07-22 13:29:18 +02:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Olivier Goffart
0c0a783095 Rename all our .60 files to .slint 2022-02-02 10:05:45 +01:00
Tobias Hunger
e6b24bceec [reorg]: Set up and populate the internal directory
Move "internal" crates into the `internal` directory. This first batch
includes most of sixtyfps_runtime but leaves the rendering backends
alone for now.

pre-commit applied some cleanups to the moved files:
 - Consistent newline at end of file policy
 - trimming trailing whitespace
 - Formatting Cargo.toml files.
2022-01-31 16:00:50 +01:00