A None value means the file on disk is the golden version.
We have an editor, the LSP and the preview that all need to at least
notice when they have newer data then their peers. So IMHO it makes
sense to have an optional document version around.
The language server protocol makes use of a version number already. This
patch moves that code into the compiler so that it is stored with the
actual data getting versioned.
Some property need to be known at compile time. We already had checks
that the binding is a compile time constant, but there was no check to
prevent, say
self.row = 42;
which wouldn't work or could even cause panic or miscompilation of
generated code
Closes#4037
We were using the has_value of the previous expression of a sequence of
expression, instead of using the last expression type to know if there
is a value.
Fixes#4070
For the slint! macro, we need to lookup files in the manifest path.
The base_directory function regressed in commit 0ff8e2c.
This was not cought by the test because it had falled back to the `pwd`
with a warning, as we used to load ressources relative to `pwd` as a
fallback.
So also check that there are no warning (meaning updating the rest of
the test so that there isn't any warnings)
Fix#4045
* Fix LineEdit with right alignement
- Align the placeholder the same way
- Make sure the cursor is visible to the right (it is drawn outside of
the TextInput, so some size need to be accounted for
(Discussed in https://github.com/slint-ui/slint/discussions/3996 )
the ensure_window and popupwindow passes were looking up the "Window"
builtin in the global register instead of in the builtin register,
causing the presence of an user-defined "Window" to cause panic.
The "Clip" and "BoxShadow" calls are not affected because they were
looking up in the builtin reguister, but using the appropriate function
is more future-proof
Fix#3916
Currently it's always the second, but that's not great.
Ideally it should be the current active element, but that's hard to
compute
This becomes extra-relevent when our preview UI has a combobox on the
top and that it is clipped to the window by winit
Fixes https://github.com/slint-ui/slint/issues/3345
This fixes the widget having the right size and sifes some strange
issues I had been wondering about for a while now!
Pass own size to children instead, so that they will always have
matching sizes.
Regression noticed in this line:
3f97d98bff/ui/tabs/downloads.slint (L77)
The following used to work:
```slint
import { Button, VerticalBox } from "std-widgets.slint";
export component Demo {
in property <[int]> mods;
VerticalBox {
alignment: start;
for xxx in true ? mods : [] : HorizontalLayout { alignment: center; Button { text: "OK!"; } }
}
}
```
But we fixed array conversion and this caused a regression with empty
array
If a branch that always return has a "void value" and the side that
doesn't return has a value, we need to synthetize a default value
so the struct is complete, even if that value is not used.