Let's call "auto" the case where the slint file doesn't specify
the row or col for a cell in a grid layout.
When the runtime expression for row/col changes, what should happen to
the subsequent cells with 'auto' behavior for their column number
(including the case where a change of row implies restarting at
column 0) ?
Option A: they move with it, as if it had all been specified that way at
compile time (dynamic auto behavior)
Option B: they stay where they are (compile-time-only auto behavior)
Both have upsides and downsides (the risk of colliding with an existing
cell exists either way), so the current decision is: let's just forbid
it.
Note that the code currently implements option A, so if one day
it's decided in favor of that, just revert this commit...
This allows to store the result into a different cache property
than the one that comes out of solve_grid_layout, which fixes
a binding loop when the text of a widget depends on its row or col
value.
ChangeLog: the row, col, rowspan and colspan properties can now be
expressions rather than having to be constants. The layout adapts when
the value of the expression changes.
I kept seeing distracting warnings when working with these testcases,
and it's better to have good examples when writing new testcases.
I didn't touch the issue_*.slint regression tests, so those will
still be testing the old syntax.
Rename grid to grid_simple, otherwise
cargo test -p test-driver-interpreter -- test_interpreter_layout_grid
runs multiple tests, no way to run only that one.
Same for nested_grid.slint given that there's a nested_grid_2.slint
- Respect the padding even for empty layouts
- When there is a non-default alignment, layouts shouldn't have a
max size: Fix the case for empty layout
- Remove max constraint in the orthogonal direction of an empty layout
The layout pass needs to see when going over the layout, that these
properties are set. So inline the element that sets these properties if
they are not set in the base.
Fixes#8091
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"
If you have a window like so:
```
component W inherits Window {
width: 200px; // or some other bindings
}
```
Before this patch, it will be converted by the compiler to something like
```
component W inherits Window {
width: 200px; // or some other bindings
min-width: width; // (not actual property, but part of the layout_info)
max-width: width;
}
```
When the window is on the screen, the platform backend will set the max
with and min width on the window manager window to the value from the
layout info.
But slint will also set the width and the height of the WindowItem to
the actual value. This will break the binding for width if any, and
will also cause the min and max with do be updated, which is wrong.
We haven't had much problem with that before, but with the
ComponentContainer, this becomes a problem as we want to set the width
and height of the inner from the outer by adding a two way binding,
which cause a binding loop at runtime.
The behavior change is that if you have a fixed window size and use that
on a MCU or platform that has a different size, the window will be
cropped or padded but will no longer be resized
Parents surch as Opacity, Clip, and co, used to steal the x and y
property of their children, making the property not what they ought to
be.
Now that we refactored recently the code so that geometry need not to be
always linked to a property of the same name, we can dissociate the x
and y property of these generated elements and their content so that the
actual "x" property of the former elementstay some value, despite its
relative item property is now 0.
Had to change a bit of code that was still assuming a literal "height"
or "width" or "y" or "x" property that no longer worked when the
geometry is dissociated from its property
Fix#1072
* Extend the cspell word list
* Remove those extensions from individual source files
* white-list licenses and such as we should not meddle with those
* Fix spelling
* Export interpreter stuff on private_api namespace
* Update api/napi/src/interpreter/value.rs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Update tests/driver/napi/build.rs
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
* Update tests/driver/napi/Cargo.toml
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
* Avoid unwanted prompt on Windows when running npm run build twice
Don't generate "napi.js" as then Windows will try to open it when running just "napi",
if nodejs registered .js as extension.
* Remove windows path workaround
It doesn't look like that it is needed.
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
This type is poorly implemented and not documented. Let's remove it for now.
It shall remain available in the git history in the event of a resurrection.
Do the default_geometry pass before injecting elements:
The reason is that the defaut_geometry pass must know if an element is in
a layout and what kind of default geometry needs to be applied depending
on its actual structure, not whatever results after we injected elements
We were relying on the default_geometry pass to set the size of elements,
but that doesn't work for elements that are not covering 100% of their
parents by default. So to that manually instead.
Fixes#915
We need to simplify all the optimized items before the move_declaration pass
This include innter item of repeater that might be used by layouts
But that also means we can now uptimize children of layouts
* Use a jpg over an png, which is much smaller
* Do not round the image
* Change the image file extensions used in the demos to reflect the
actual image format being used
* Do not use symlinks for images: This breaks the WASM demos