-
Notifications
You must be signed in to change notification settings - Fork 613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrapper component breaks layout #6821
Comments
We discussed this a bit offline. So the use of component RedRectangle inherits Rectangle {
background: red;
}
component Wrapper {
RedRectangle {}
}
export component Test inherits Window {
//RedRectangle {}
Wrapper {}
} The use of However, what's odd and looks like a bug is this: component RedRectangle inherits Rectangle {
background: red;
width: 300px;
height: 300px;
}
component Wrapper inherits Rectangle {
RedRectangle {}
}
export component Test inherits Window {
HorizontalLayout {
RedRectangle {}
//Wrapper {}
}
} This example is fixed in size, it can't be resized. That makes sense in terms of constraints being propagated. However, using I think that it's either a bug that this happens, or we're lacking a bit in the documentation that explains when these constraints are not propagated anymore. |
@tronical: in the last example, the From https://docs.slint.dev/latest/docs/slint/src/language/concepts/layouting#preferred-size
That docs mention it is the same as maximum is minimum size, but that doesn't seems to be the case unless there are layouts |
I would also have expected the same behaviour of minimum and maximum size, i.e. that component Wrapper inherits Rectangle {
// I thought this is implicit:
min-width: r.min-width; // plus any children, if there were any
max-width: r.max-width;
min-height: r.min-height;
max-height: r.max-height;
inner := RedRectangle {}
} However that's not the case. Is this a bug? It seems that's only the case when component Wrapper inherits Rectangle {
min-width: r.min-width;
max-width: r.max-width;
min-height: r.min-height;
max-height: r.max-height;
r := VerticalLayout { RedRectangle {} }
}
Is this the part of documentation you mean: "just like other constraints (maximum and minimum size)" ? It seems to me that in any case the docs should be extended to explain propagation of constraints, i.e. when they are propagated. |
Hi,
I noticed that a wrapper component which does not derive from anything breaks the layout. Is a non derived component not fully supported or is there something else I am not able to see?
With Wrapper:
Without Wrapper:
Another interesting case when the base inside the wrapper has no children:
Or when the element inside the wrapper is conditional:
I would have expected that the wrapper does not change the layout in any way.
The text was updated successfully, but these errors were encountered: