Commit graph

1148 commits

Author SHA1 Message Date
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
Tobias Hunger
e55f2ae04e compiler: Add a ListResources option for resource embedding
... which will list all resources that are not going to get embedded
as `None` in the Document's `embedded_file_reosurces`.

The idea is to use that field to find all used resources in the
live preview so that we know what we can watch.
2024-10-14 11:31:34 +02:00
FloVanGH
f8f1d468a0
widgets: fix tabs overflow behaviour (#6517) 2024-10-11 12:15:27 +00:00
Tobias Hunger
3d3bf9f01b lsp: Pass invalidation of files on to live-preview 2024-10-10 09:31:11 +02:00
FloVanGH
b3f19e446e
LineEdit: fixes cursor draws out of bounds (#6382) 2024-10-09 14:31:42 +00:00
Renato Araujo Oliveira Filho
1e4de3fe0c
Implement ScrollBarPolicy property for ScrollView (#6442)
ChangeLog: ScrollView: added  vertical-bar-policy and horizontal-bar-policy

Fixes: #3552
Fixes: #5578
2024-10-08 17:02:17 +02:00
Qubi0-0
f6184ef858
Fix Generated C++ code issue with keywords (#6441)
Fixes #5613

ChangeLog: C++: generated code adds `_` to the end of identifier that would otherwise be keywords
2024-10-08 15:03:03 +02:00
Olivier Goffart
0c36499936
Rename common.slint -> about-slint.slint
The file used to contain many things but now it only contains AboutSlint
widget, so we can as well rename it accordingly
2024-10-08 14:52:03 +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
04e03ed197
Rust generator: don't run the init code twice for popups (#6447)
Don't run the `init=>` callback in popup twice

ChangeLog: rust: Fixed `init=>` callback on PopupWindow ran twice.
2024-10-04 17:17:36 +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
FloVanGH
fd9807515f
TextInput: use selection colors from palette (#6381)
* Update internal/compiler/builtins.slint

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>

---------

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2024-09-30 10:56:22 +00:00
Olivier Goffart
53e79000a4
Layouting: Take in account explicit constraints when generating layout info base on content (#6306)
Fixes #6285

ChangeLog: Fixed geometry constraints when they are partially infered
from the content, and partially infered from the explicit constraints
2024-09-30 10:57:23 +02:00
Florian Blasius
71d1d814ce Revert "TextInput: use selection colors from palette"
This reverts commit 044518ee81.
2024-09-30 08:43:41 +02:00
Florian Blasius
044518ee81 TextInput: use selection colors from palette 2024-09-30 08:41:41 +02:00
Olivier Goffart
cfa115affa LSP: changed callbacks auto-completion
ChangeLog: LSP: auto-completion of changed callbacks
2024-09-26 18:20:03 +02:00
Olivier Goffart
61565e1ba9 Visit expressions of changed callback during binding analysis
Fixes #6331  (second part)
2024-09-26 17:54:21 +02:00
Olivier Goffart
87d72a8553 Fix changed callback of an unused property
If the property was not used, it was optimized out and the compiler
would panic
Fixes #6331

ChangeLog: compiler: Fix changed callback of an unused property
2024-09-26 16:51:31 +02:00
Olivier Goffart
8ac0c792e8 Update derive_more 2024-09-26 09:14:58 +02:00
Olivier Goffart
a9aa8bca42 compiler: Simplify a function now that we can use rust 1.77 2024-09-26 09:14:58 +02:00
ogoffart
eb273a63ee Bump version number to 1.9.0 2024-09-25 11:49:15 +00:00
Josh Wood
6a131e2648
Added PropertyAnimation.direction property for controlling animation direction (#6261)
Closes #6260

ChangeLog: Added property for controlling animation direction
2024-09-24 19:55:24 +02:00
Olivier Goffart
9a1e3c40cc Fluent CheckBox: text should be using the normal text color
ChangeLog: Checkbox: fix text color in fluent style
Fixes #6239
2024-09-24 10:38:13 +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
Simon Hausmann
cd2b738c7a Rename SwipeGestureRecognizer to SwipeGestureHandler
The origin of this proposal is the name of the `swipe-left`, etc.
directional, boolean properties. They're missing another verb in their
name. In principle the right choice would be "recognize". That is what
the type name suggests, that's the term the documentation uses, so the
code should read `recognize-swipe-left: true;`. However that is a long
word. "Handle" is a verb that's simpler. It's also more generic (that's
a downside), but it's otherwise short enough to make things look
"right":

```
SwipeGestureHandler {
    handle-swipe-left: true;
    swiped => { something.naviate-left(); }
}
```

Therefore this patch proposes to rename the type to SwipeGestureHandler
and prefixes the boolean directional properties with "handle".
2024-09-18 16:37:27 +02:00
Olivier Goffart
d2bd5366f4 Timer::set_interval
Don't return an Option, just return 0 when the timer is not started.
As discussed in the API review, the rational is that the interval is
just like a field in a struct and when the struct is default
constructed, it is initialized to 0
2024-09-18 09:24:39 +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
02467bd4cc
Change mod() to always return positive number (#6179)
* Change `mod()` to always return positive number

Closes #6178

ChangeLog: The mod function was changed to always return a positive value (#6178)
2024-09-17 11:37:32 +02:00
FloVanGH
4b6b64f521
Select text on SpinBox on double click (#6157)
* Select text on SpinBox on double click

* Update CHANGELOG.md

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

* Code review feedback

---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2024-09-16 09:01:10 +00:00
FloVanGH
2e383e3d84
Fixed button of cup. ComboBox not centered on bigger height (#6155)
* Fixed button of cup. ComboBox not centered on bigger height
* Update CHANGELOG.md

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

---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2024-09-16 07:30:23 +00:00
Arnold Loubriat
7e236017a7 Apply AccessibleRole::ListItem to the standard ListItem component 2024-09-16 09:15:39 +02:00
Olivier Goffart
3b6cc0f8cf Flickable: size in % bow refer to the Flickable's size instead of the viewport
This is consistant so that `width: 100%` is the same as `width: parent.width`

This basically revert the previous commit that was just working around
the debug_assert to actually fix the behavior

ChangeLog: width and height expressed in `%` unit for an element in a
Flickable now refer to the size of the Flickable instead of that of
the viewport
2024-09-12 09:45:24 +02:00
Olivier Goffart
e98780fafc Fix compiler panic when using % size in a flickable
The viewport of a flickable is of ElementType::Native, and `lookup_property`
don't query the builtin reserved properties in that case.

This commit fix the assert by allowing Type::Invalid as well.

Fixes #4163
2024-09-12 09:45:24 +02:00
Olivier Goffart
3bc758bc3f Janitor: deps update 2024-09-11 17:19:36 +02:00
Olivier Goffart
7d446c98a0
Fix generated setter and getter of public property alias in globals
We need to skip the generation of the local property so it directly
forward to the alias in the public property

Fixes #5855
ChangeLog: Fixed generated getter and setter of alias properties in globals
2024-09-11 08:35:38 +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
ea3072d696 Path: fix panic when accessing properties on sub commands
We need to keep the ElementRc around with its properties so that
accessing them doesn't panic later
2024-09-10 11:44:13 +02:00
Olivier Goffart
5663ddd9cc
SwipeGestureRecognizer (#6005) 2024-09-09 14:40:55 +02:00
Olivier Goffart
0feb674612
unmark changed callback as experimental
Closes #112
2024-09-09 14:40:16 +02:00
Nigel Breslaw
482308f5da
Add Math.atan2 to the inbuilt math function
Math.atan2(y, x) -> angle
2024-08-30 09:55:10 +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
Enyium
5a796e6dc0
Change debug() separator from , to . (#5997)
This is also how JavaScript's `console.log()` behaves.

Fixes #5991.
2024-08-29 12:02:13 +02:00
Tobias Hunger
bacae03919 compiler: More wrappers around rowan methods
... in SyntaxNode and SyntaxToken.

And do a small code cleanup enabled by this.
2024-08-28 18:02:47 +02:00
Olivier Goffart
bf1b014840 Timer: fix timer when two timers have the same id
We need to give unique name to optimized item as well, otherwise the
properties ends up the same.

Also fix the optimized element and timer when inlining

Fixes #5977
Fixes #5976
2024-08-28 16:21:34 +02:00
FloVanGH
5b8f68f43b
visual clamp slider (#5967) 2024-08-28 10:41:24 +00:00
FloVanGH
039f33eaae
Added scrolled callback to ListView and ScrollView (#5964) 2024-08-27 10:18:43 +00:00
Olivier Goffart
f57cd6735b janitor: better panic message when accessing wrong NamedReference 2024-08-27 12:01:54 +02:00
FloVanGH
c9f005b40a
Fixed TimePickerPopup does not open minute view by click on selected hour (#5959) 2024-08-27 09:56:55 +00:00
FloVanGH
7a0c3dcc50
Do not trigger current-item-changed on StandardListView if current-item is set on the same value (#5958) 2024-08-27 07:22:18 +00:00