Skip to content
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 preview: fix some issue related to geometry #4229

Merged
merged 1 commit into from
Jan 2, 2024
Merged

Conversation

ogoffart
Copy link
Member

  • 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 LSP crash when specifying padding based on parent width #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
@ogoffart ogoffart added the a:lsp slint-lsp and formating (mO,bT) label Dec 28, 2023
@ogoffart ogoffart requested a review from hunger December 28, 2023 10:20
Comment on lines +135 to +140
if i-preview-area-container.has-component && root.preview-area == i-preview-area-container.component-factory : Rectangle {
init => {
i-preview-area-container.width = clamp(i-preview-area-container.width, i-preview-area-container.min-width, i-preview-area-container.max-width);
i-preview-area-container.height = clamp(i-preview-area-container.height, i-preview-area-container.min-height, i-preview-area-container.max-height);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess in the future we can do this with a changed callback? (property <bool> condition: ...; changed condition => { ... })

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, if we had changed callback we couldn't need that.

@ogoffart ogoffart merged commit ba738be into master Jan 2, 2024
34 checks passed
@ogoffart ogoffart deleted the olivier/lsp2 branch January 2, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:lsp slint-lsp and formating (mO,bT)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LSP crash when specifying padding based on parent width
2 participants