-
Notifications
You must be signed in to change notification settings - Fork 536
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
LSP crash when specifying padding based on parent width #3989
Comments
In order to understand this, we must understand that the preview UI uses itself Slint and uses this UI:
The ComponentContainer will get the inner's window property and create this binding:
It comes naturally that we then have this binding loop:
We'll have to break that loop somehow. Note that in principle, this kind of loop already exist and should probably be forbidden by the compiler as they tend to cause issues like #2902 This works because when not using a ComponentContainer, the normal window break the layout by letting one event loop iteration in between the min-max size query and width/height adjustement. But if the loop is actually real and doesn't converge, it creates infinite changing size. |
It did not like this binding since it caused a binding loop in the preview UI (see slint-ui/slint#3989). Fortunately we can just replace it with a stretching rectangle.
- make sure that the initial size is proper by calling show() on the preview ui after the factory has been set - ensure that there is no recursion if the inner layout info depends on the size (Fixes #3989) - Ensure that the geometry constraints are respected when previewing a component that was already resized
- make sure that the initial size is proper by calling show() on the preview ui after the factory has been set - ensure that there is no recursion if the inner layout info depends on the size (Fixes #3989) - Ensure that the geometry constraints are respected when previewing a component that was already resized
Platform: Linux, Language: Rust, Editor: VS Code
The following component is crashing the LSP when I press "Show Preview":
It appears to be triggered by the
padding-left: parent.width * 0.015;
line, since the crash disappears when the line is removed.The backtrace:
The text was updated successfully, but these errors were encountered: