Commit graph

1484 commits

Author SHA1 Message Date
Olivier Goffart
60e7d54e67 Compiler better test coverage in case of error and fix panics
The compile_syntax_node was used by the syntax_test in case of error
to still cover the coverage, but commit e3908cfce6
made this function a noop when there is an error already.

The LSP does try to build an object tree even though there are error in
order to have the most information even in that case, so we must ensure
that it doesn't panic left and right.

This commit also fix some of these panics.
2024-06-11 19:22:59 +02:00
Olivier Goffart
47a61dda10 Fix compiler crash with invalid code 2024-06-11 19:22:59 +02:00
Olivier Goffart
b3de1e848e Fix inlining of PopupWindow
ammend previous commit to fix building the examples

When inlining things inside a Popup, we must process the popups first.
But in order to inline the popup inside another component, we must
process the popups last.
This makes the code a bit more complicated
2024-06-10 22:18:06 +02:00
Olivier Goffart
42704eee65 Fix @children in a PopupWindow
Fixes #5375
2024-06-10 22:18:06 +02:00
Olivier Goffart
a780dd4905 Testing: Fix duplicated accessibility element
This fix the C++ todo test that wasn't run because of a typo

When an element is optimized in another one, only the first one should
report the accessible properties. (because element with accessible
properties cannot be optimized so they are always the first)
2024-06-07 13:18:12 +02:00
Olivier Goffart
3f80b5ba59 Ignore all clippy warnings in generated code
We don't want user to see clippy warnings from our generated code

Relates to #1874
2024-06-06 11:55:37 +02:00
Luc Fauvel
44a537d902
Implemented resizing for non-decorated winit windows (#5026)
Fixes #5023

* Implemented resizing for non-decorated winit windows

* Fixed formatting

* Changed direction match to use a tuple, reduced resize border size, returned after handling resize

* Added is resizable check for before resizing winit window

* Added resize-border property to window

* Formatted code

* Change resize-border from float to length
2024-06-06 11:17:05 +02:00
Simon Hausmann
97dc776557 Add missing accessible-action-default for Switch
... and fix Switch defaults to match the docs for all styles.
2024-06-06 01:15:05 -07:00
Florian Blasius
557c95d0eb TimePicker: Fix foreground of selected input for cosmic 2024-06-06 09:53:29 +02:00
Simon Hausmann
8cc2620dee Fix up clock and keyboard icon in the qt style
These were originally copied from cosmic but should come from material, as the other icons from the date picker PR.
2024-06-06 09:28:56 +02:00
Olivier Goffart
445802c46d date_time: simplification and cleanups 2024-06-06 09:03:50 +02:00
Olivier Goffart
3da0ee5bb9 DatePicker: Logic in C++
Had to simplify a bit the rust logic to make it work
2024-06-06 09:03:50 +02:00
Florian Blasius
973ecac989 DatePicker: finished features 2024-06-06 09:03:50 +02:00
Florian Blasius
f75cedb893 DatePicker: calendar 2024-06-06 09:03:50 +02:00
Florian Blasius
fe6dba9779 DatePicker: base setup 2024-06-06 09:03:50 +02:00
Simon Hausmann
b162e9df45 Make it possible to toggle the state of checkboxes via accessibility 2024-06-05 09:51:41 -07:00
Florian Blasius
3ccee816be
Added TimePicker widget (#5251) 2024-06-05 15:23:06 +02:00
Olivier Goffart
7f014050ac Qt StandardTableView: properly elide the cell in the text
Contrary to the ListView that needs a minimum size and can be scrolled,
the TableView needs the cell to be ellided and don't have a minimum size

Fixes #5285
2024-06-05 12:29:43 +02:00
Simon Hausmann
15b517a554 Emit a warning to stderr (debug_log) when using the ElementHandle API but there's no debug info present 2024-06-05 01:29:58 -07:00
Simon Hausmann
1a8ce3c659 Add support for optimized rectangles in ElementHandle
Keep merging elements, but remember the boundaries in the debug info, separated by a slash.

Also fixed tests that rely on accessible-label being set only once. For example

```
Button { text: "foo"; }
```

will certainly have "foo" as accessible-label on `Button`, but its internal `Text` element has
an implicit "accessible-label" set to the same
value.

So don't rely on that for now but search by id instead.
2024-06-05 01:29:58 -07:00
Simon Hausmann
c27cbb94a6 Simplify spinbox test
Replace dummy accessible-label use with the new element id lookup mechanism for testing.
2024-06-05 01:29:58 -07:00
Simon Hausmann
4eef2d4936 WIP: Add find_by_element_type_name 2024-06-05 01:29:58 -07:00
Simon Hausmann
a52fe6bbfc Make element debug information configurable
The `SLINT_EMIT_DEBUG_INFO` environment variable needs to be set for Rust and C++ builds. For the interpreter it's always enabled, since ... we have it.
2024-06-05 01:29:58 -07:00
Olivier Goffart
43a336b534 C++ part of element_ids
Simplify a bit the llr generation so that there is less code duplication
between Rust and C++
2024-06-05 01:29:58 -07:00
Olivier Goffart
8add2e4ebd element_ids: Can't return a SharedString by value from the vtable
also compile the LSP
2024-06-05 01:29:58 -07:00
Simon Hausmann
73b5136f98 WIP: Search by qualified element id 2024-06-05 01:29:58 -07:00
Simon Hausmann
5bfa6044b5 Don't optimized away rectangles that have dedicated accessibility roles 2024-06-05 01:29:58 -07:00
ogoffart
3a6e34ba45 Bump version number to 1.7.0 2024-06-04 20:34:29 +00:00
Olivier Goffart
94af4d2832 Don't optimize array
They are model and if the model is copied, the changes in model need to
apply to all copies.

Fixes #5249
2024-06-04 15:24:36 +02:00
Tobias Hunger
d9224cd58f janitor: Use more workspace dependencies 2024-06-04 14:58:29 +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
Olivier Goffart
78f265f811 Don't remove the Row item if it has a PopupMenu
Otherwise the access to the PopupMenu parent will fail to compute the
x,y position of the popup as the popup's reference the Row as its
parent.

Fixes #5259
2024-06-04 13:31:36 +02:00
Tobias Hunger
b4c89bb29a janitor: Fix warning about using for to iterate over an &Option 2024-06-03 16:59:54 +02:00
Arnold Loubriat
0b8a0a90dd Also fix the Qt theme 2024-06-03 01:38:06 -07:00
Arnold Loubriat
f97de46c6f Set accessible min/max values on progress indicator widgets 2024-06-03 01:38:06 -07:00
Simon Hausmann
d183498c4e Add support for step-size to SpinBox rendered by the Qt style
Fixes #5325
2024-05-31 09:45:29 -07: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
Florian Blasius
dc4e421f2c
Added step-size to SpinBox (#5293) 2024-05-31 09:45:37 +00: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
3f32550859 Fix property access from inlined init code
The `fixup_init_expression` was not called for every instructions when it was inlined,
causing invalid code in further passes

Fixes #5260
2024-05-28 16:24:38 +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
1040946d7f Fix rust warnings in generated code with changed callbacks
We sometimes generate dead code or unused variables for our expressions.
Most code is already covered with the `#[allow]`, so we need to also
allow it for callbaks
2024-05-27 17:51:02 +02:00
Tobias Hunger
d852e42431 compiler: Add ConditionalElement as a possible child of Element
It's not critical, but nice to have this option documnted (and the code
to find all `ConditionalElement`s generated).
2024-05-27 16:53:22 +02:00
Florian Blasius
5313044f36
Fix text update of SpinBox (#5243) 2024-05-16 05:07:48 +00:00
Florian Blasius
310b01a2e2
ComboBox reset current on model changed (#5217)
---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2024-05-15 14:28:57 +02:00
Florian Blasius
a3d4112897
Added placeholder-text to TextEdit (#5239)
---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2024-05-15 10:20:13 +00:00
Florian Blasius
bd777b4312
Added TextEditBase (#5236) 2024-05-15 06:26:50 +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