From e9579a0285cc5c454899ad262d8e3ec694c9278b Mon Sep 17 00:00:00 2001 From: John Haddon Date: Fri, 15 Dec 2023 09:41:22 +0000 Subject: [PATCH] Viewer : Fix layout jiggle when hiding toolbar 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. --- python/GafferUI/Viewer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/GafferUI/Viewer.py b/python/GafferUI/Viewer.py index 1601d1e3c67..c1753404c04 100644 --- a/python/GafferUI/Viewer.py +++ b/python/GafferUI/Viewer.py @@ -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