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

Viewer : Fix layout jiggle when hiding toolbar #5589

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

johnhaddon
Copy link
Member

By setting the child to None and then hiding the frame, we were causing Qt to do two lots of layouting, one with an empty frame and one with nothing. This could cause "jiggle" when switching between tools in the Viewer.

In an ideal world Qt would batch up these layout operations and do them once with no redraw in between. In fact I don't really know why it doesn't. As far as I know, it needs to return to the event loop to perform them, and I don't see where or how that's happening. But in lieu of real understanding, this is a simple and logical enough fix that removes a nasty visual annoyance.

@ericmehl, this removes the jiggle caused by the tooltips in #5558.

By setting the child to `None` and _then_ hiding the frame, we were causing Qt
to do two lots of layouting, one with an empty frame and one with nothing. This could cause "jiggle" when switching between tools in the Viewer.

In an ideal world Qt would batch up these layout operations and do them once with no redraw in between. In fact I don't really know why it doesn't. As far as I know, it needs to return to the event loop to perform them, and I don't see where or how that's happening. But in lieu of real understanding, this is a simple and logical enough fix that removes a nasty visual annoyance.
@johnhaddon johnhaddon self-assigned this Dec 15, 2023
Copy link
Collaborator

@ericmehl ericmehl left a comment

Choose a reason for hiding this comment

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

Marvelous! This fixes the jiggle nicely and gives an extra polish to the UI. LGTM

@ericmehl ericmehl merged commit b4b5458 into GafferHQ:1.3_maintenance Dec 19, 2023
4 checks passed
@johnhaddon johnhaddon deleted the viewerJiggleFix branch March 15, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants