Skip to content

Commit

Permalink
Viewer : Fix layout jiggle when hiding toolbar
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
johnhaddon committed Dec 15, 2023
1 parent d0221be commit e9579a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/GafferUI/Viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,11 @@ def setNode( self, node ) :
if self.__node is not None :
toolbar = self.__nodeToolbarCache.get( ( self.__node, self.__edge ) )
self.setChild( toolbar )
self.setVisible( True )
else :
self.setVisible( False )
self.setChild( None )

self.setVisible( self.getChild() is not None )

def getNode( self ) :

return self.__node
Expand Down

0 comments on commit e9579a0

Please sign in to comment.