Commit graph

961 commits

Author SHA1 Message Date
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
Simon Hausmann
d03a6f0071 Fix Slider's released callback not being invoked when the user releases it outside the widget's boundaries
Fixes #5173
2024-05-09 14:14:09 +02:00
Olivier Goffart
0929e3dfc1 Slint: make the abs work with unit types 2024-05-08 19:04:22 +02:00
Olivier Goffart
5c3732c74e C++: fix string to float so that it doesn't depends on the current locale 2024-05-07 14:58:07 +02:00
Tobias Hunger
2e3b00e38e janitor: Fix some clippy warnings pre-release
Nothing that should be controversial, but the
`internal/compiler/builtin_macros.rs` could point to a thinko in the original
commit.
2024-05-06 16:47:14 +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
Simon Hausmann
43e3c57b3b Prospective fix for rustdoc warnings about unknown cfg's
Let cargo know about our internal cfgs.
2024-05-06 12:00:44 +02:00
Olivier Goffart
c5f857ffc9 Change callback: gate behind experimental flag 2024-05-02 22:25:53 +02:00
Olivier Goffart
80f37a3acf C++ ChangeTracker implementation 2024-05-02 22:25:53 +02:00
Olivier Goffart
cadcd4caf4 Change callback: rust code generation 2024-05-02 22:25:53 +02:00
Olivier Goffart
2e4d1f2427 WIP: work on changed callback 2024-05-02 22:25:53 +02:00
Olivier Goffart
32bf6608e9 Parse changed callbacks 2024-05-02 22:25:53 +02:00
Dirley Jordan
35b9c1e738
Fix a positive minimum causing an incorrect slider/spinbox value (#5148)
sets the default value to that of the minimum
2024-04-30 09:30:31 +02:00
Olivier Goffart
12d904a71c
Fix compiler panic with init in a component inlined into a repeater
The problem was that the code from #4322 inlined the init code in the
parent Component as at that point, the per-repeater component don't
exist yet.
Fix it by removing the workaround from #4322, but changing the order of
the passes so that the init code are already proccessed before any
inlining. This required to change the order of a bunch of passes.

Fixes #5146

As a drive-by, also add the missing C++ implementation of set_animated_value
for Brush that was discovered by the test. (Code wouldn't compile)
2024-04-29 15:34:12 +02:00
Olivier Goffart
a3df400308
Basic tests for the Button 2024-04-26 17:25:44 +02:00
Noah Sweilem
6ede27a364 Add text stroke properties to Text element 2024-04-26 13:16:19 +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
Simon Hausmann
d1dd89528b Simplify creation of focus() and clear-focus() forward functions from components to the inner focus forward element
... by sharing more code in the compiler.
2024-04-26 11:09:11 +02:00
Simon Hausmann
31767eb6ab Add a clear-focus()function on all elements that have a focus() function
This is the counter-part, which removes focus from the element if it's currently focused. The window - if focused - may still be focused towards the windowing system.
2024-04-26 11:09:11 +02:00
Olivier Goffart
4856f387ee C++ Todo example: add test 2024-04-22 13:54:28 +02:00
Olivier Goffart
5a4713aa17 C++: add #pragma once to generated file 2024-04-22 13:06:05 +02:00
Olivier Goffart
64404ceca2 accessibility: return an Option for accessible string values
So we can know whether the item had the property set at all or not
2024-04-19 11:23:26 +02:00
Olivier Goffart
c2b3bbdf92 Accessibility: add accessible-label and accessible-set-value to LineEdit 2024-04-16 15:50:53 +02:00
Olivier Goffart
13127dc71c Accessibility: Add support for accessibility-action-* callback (#5073)
Merge branch 'feature/accessibility'

 Conflicts:
	internal/compiler/widgets/cosmic-base/button.slint
	internal/compiler/widgets/cupertino-base/button.slint
	internal/compiler/widgets/fluent-base/button.slint
	internal/compiler/widgets/material-base/button.slint

Also updated license header in actions.slint
2024-04-16 15:02:25 +02:00