Olivier Goffart
5bd20def0e
Experimental support for MenuBar
...
Introduces `MenuBar{ ... }` that can be put in a Window
2024-11-20 09:25:37 +01:00
Olivier Goffart
650fd0eef5
Fix panic when calling expression containing un-called macro
...
Fixes #6650
2024-11-11 16:08:22 +01:00
Olivier Goffart
e854e11399
Error when making a for
over an empty array
...
Instead of panicking.
Attempt to fix it in #6765 didn't work for C++.
Code generation might be hard for C++, so I thought it's better to error out.
Fix #6760
2024-11-11 13:23:56 +01:00
Olivier Goffart
51e4d4562a
Do not print the internal struct name in LSP tooltip or error message
...
just strip the `slint::` or `slint::private_api::`
This is not a 100% match to the slint name (eg, LogicalPosition) but
it is better anyway
2024-11-04 17:09:57 +01:00
Olivier Goffart
dff19c52da
Fix assertion failed: lhs_lookup.is_local_to_component
...
Fixes #6632
2024-10-28 11:44:25 +01:00
FloVanGH
14c7910d49
PopupWindow: added close-policy property ( #6614 )
...
* Update api/cpp/include/slint_window.h
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Update docs/reference/src/language/builtins/elements.md
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
* Update internal/core/window.rs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Update internal/interpreter/eval.rs
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
* Update internal/backends/qt/qt_window.rs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Update internal/interpreter/dynamic_item_tree.rs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Update internal/compiler/passes/materialize_fake_properties.rs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2024-10-24 09:27:39 +00:00
Olivier Goffart
6717e627a1
Fix panic when a layout constraint has an Expression::Invalid as binding
...
We can detect this case earlier
Fix #6590
2024-10-22 09:35:57 +02:00
Olivier Goffart
6c81d5069e
Fix parsing of unfinished import
statement
...
Fix #6588
Note for the test: parse error at the end of the file are actually
reported at offset 0. Use a trick to add more `^` at the beginning to
mean that.
(Offset 0 is actually offset 1 as the column starts at 1)
2024-10-22 09:35:46 +02:00
Olivier Goffart
4e50fbdb15
Fix panic making an alias to a private property
...
Fixes #6587
2024-10-22 09:35:31 +02:00
Olivier Goffart
13d44130d9
Fix compiler panic binding to property with syntax error ( #6572 )
...
Fixes #6519
2024-10-16 21:35:35 +02:00
Olivier Goffart
f0e02a3aa3
Fix panic with invalid code
...
Fix #6518
2024-10-15 11:42:28 +02:00
Olivier Goffart
4718d5b050
Fix invalid node generated while parsing invalid @tr
( #6560 )
...
Fixes #6512
The TrPlural must always have an expression otherwise it panics later.
(Also adjust the panic message when nodes are missing)
2024-10-15 10:23:56 +02:00
Simon Hausmann
0b028bfb6f
Add support for a font-metrics property to Text/TextInput. ( #6452 )
...
The struct held provides access to the design metrics of the font scaled
to the font pixel size used by the element.
ChangeLog: Slint Language: Added font-metrics property to `Text` and `TextInput`.
Closes #6047
2024-10-05 17:00:46 +02:00
Olivier Goffart
d6706494a5
Binding between a read only property to input-output is deprecated ( #6419 )
...
ChangeLog: deprecated two way binding between `in` and `in-out` property
Fixes #6400
2024-10-01 16:00:06 +02:00
Enyium
4509496143
Improve layout-related error message. ( #6264 )
...
The phrasing shouldn't be universal, so users aren't taught it would always apply to *all* kinds of layouts.
2024-09-24 09:43:02 +02:00
Olivier Goffart
bcdc3e1cee
Timer: make the interval
property mandatory
...
A default of 0 is not a great default because that's way too often
2024-09-18 09:24:39 +02:00
Olivier Goffart
0c8a9fcefb
Fix compiler panic when accessing path.commands in expressions
...
Fixes #5564
2024-09-10 13:36:09 +02:00
Olivier Goffart
1d3e9120d8
Avid reporting further error when an element is misspelled
...
eg, don't report an error for each callback or animation or changed
event that the the property doesn't exist or such.
Also reword the message when an element doesn't exist. Use "element"
rather than "type" as it is more accurate.
2024-08-29 13:10:35 +02:00
Olivier Goffart
3a59950751
Experimental support for named callback parameters
...
And use that in the lsp/ui implementation instead of comments.
This is only a parser support for now, the name is otherwise unused.
Hence I rather keep that experimental.
2024-08-19 14:10:01 +02:00
Olivier Goffart
a9f526491a
Timer Element
...
Closes #5724
2024-08-16 16:36:38 +02:00
Olivier Goffart
3a12ebf7ab
Report an error when accessing a function within a PopupWindow
...
instead of panicking
Fixes #5852
2024-08-16 10:31:13 +02:00
Olivier Goffart
9b71cf1a36
Math postfix member functions on numbers
...
Closes #5328
2024-08-15 14:52:13 +02:00
Olivier Goffart
875d20f1ac
Add test for deprecated import
...
Should have been part of a0dd978f8a
2024-07-03 16:44:31 +02:00
Olivier Goffart
66370b6bda
Add export { ... } from "....slint";
syntax. ( #5533 )
2024-07-03 12:50:40 +02:00
Simon Hausmann
7896e645b2
Permit rotation properties on Text elements without children
...
This works with Skia, Qt, and FemtoVG.
cc #1481
2024-07-03 09:08:23 +02:00
Olivier Goffart
a63618fcfe
Fix error messages with invalid change callback
2024-06-28 10:45:45 +02:00
Olivier Goffart
42a2c6a569
Only generate code for the exported Window
...
Have a warning when a component is exported from the main file and
doesn't inherit Window.
Unless it's the last component, for compatibility with Slint 1.6
Also don't warn in the interpreter
2024-06-25 15:13:06 +02:00
Olivier Goffart
539abfc550
Revert "Add a warning if a PopupWindow is in a layout"
...
This reverts commit 66652cdc1d
.
The warning in the gallery are hard to fix because the component inherit
from a layout and there is nowhere to place the popups
2024-06-24 16:38:37 +02:00
Olivier Goffart
8933f3308c
Remove the error when using @children
on the root component
...
This complicates multi-component handling
2024-06-21 11:58:09 +02:00
Olivier Goffart
acb7da11d2
fix missing warning of missing export
...
... for last component when globals are exported
2024-06-21 11:57:49 +02:00
Olivier Goffart
47a61dda10
Fix compiler crash with invalid code
2024-06-11 19:22:59 +02:00
Olivier Goffart
42704eee65
Fix @children
in a PopupWindow
...
Fixes #5375
2024-06-10 22:18:06 +02:00
Olivier Goffart
66652cdc1d
Add a warning if a PopupWindow is in a layout
...
This is not intuitive since the position of the PopupWindow will not be
handled by the Layout
2024-06-04 13:31:36 +02: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
Olivier Goffart
8221e2e4b2
Fix stack overflow in purity check
...
Fix #5220
2024-05-29 06:42:37 +02:00
Olivier Goffart
bc8e18e148
Fix compiler panic when trying to set a function in a state
...
Fixes #5246
2024-05-28 17:25:15 +02:00
Olivier Goffart
61233d8f6b
Only mark builtin StyleMetrics as deprectated.
...
User defined component or global named StyleMetrics shouldn't be deprecated
2024-05-28 13:45:56 +02:00
Olivier Goffart
25ef8f8711
Fix declaring callback alias that override a property
...
Do the check for existing property before handling of callback aliases
Fixes #5205
2024-05-10 13:50:04 +02:00
Olivier Goffart
0929e3dfc1
Slint: make the abs work with unit types
2024-05-08 19:04:22 +02:00
Olivier Goffart
af1aa2991e
Fix component that inherits from PopupWindow
...
This regressed in commit 12d904a71c
which changed the order of the pass to get the lower_popup pass before
the first inlining pass.
If by chance (which is likely if one have children), the component that
inherits from PopupWindow was inlined in that pass, it would be as
if it was not a component, and it would be removed from its parent.
But since it is no longer inlined, we need to support that case and
delay the removal when processing the component that holds that popup.
2024-05-06 13:20:25 +02:00
Olivier Goffart
2e4d1f2427
WIP: work on changed callback
2024-05-02 22:25:53 +02:00
Simon Hausmann
10e5c228b7
Fix calling clear-focus() on non-focusable elements not producing an error
2024-04-26 11:09:11 +02:00
Olivier Goffart
0f05089d5e
Polish the C++ and Rust HSV API
2024-04-15 18:18:00 +02:00
Simon Hausmann
ae2e0197f8
Deprecate the use of StyleMetrics for users of the public API ( #4947 )
2024-04-15 17:07:05 +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
Olivier Goffart
ea0227098a
Throw an error when a callback aliases itself
...
Instead of panicking
Fixes #4938
2024-03-26 18:14:31 +01: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
42a4286048
Fix missing error when calling argb() with too many arguments
...
This is technically a breaking change if someone was calling it with too
many args by mistake, but i think it's fine to do this as a bugfix
2024-03-22 14:57:07 +01:00
Olivier Goffart
c553eb4398
compiler: Don't panic when using foo.focus(something)
...
Just ignore the case where focus has more argument that planed as it has
been reported as an error earlier.
Also fix the error message for calling member function with the wrong
number of argument to not include the base in the count.
Fix #4883
2024-03-19 11:06:08 +01:00