Skip to content

Commit

Permalink
PlugLayout : Update layout when custom widget metadata changes
Browse files Browse the repository at this point in the history
This fixes the hiding of the unwanted "Execute" buttons in the DispatchDialogue, because it overwrites the `layout:customWidget:dispatchButton:widgetType` metadata _after_ creating the UI for the nodes.
  • Loading branch information
johnhaddon committed Oct 27, 2023
1 parent cacbae1 commit 86c1207
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Fixes
- Fixed a bug preventing anything except strings from being copied and pasted.
- Fixed likely cause of crash when resizing Spreadsheet column width (#5296).
- Reference : Fixed rare reloading error.
- PlugLayout : Fixed lack of update when `layout:customWidget:*` metadata changes.
- Dispatch app : Removed unnecessary and misleading "Execute" button.

1.3.5.0 (relative to 1.3.4.0)
=======
Expand Down
3 changes: 3 additions & 0 deletions python/GafferUI/PlugLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,9 @@ def __parentMetadataChanged( self, key ) :
if re.match( self.__layoutName + ":section:.*:summary", key ) :
self.__summariesDirty = True
self.__updateLazily()
elif re.match( self.__layoutName + ":customWidget:.*", key ) :
self.__layoutDirty = True
self.__updateLazily()

def __plugDirtied( self, plug ) :

Expand Down
3 changes: 3 additions & 0 deletions python/GafferUITest/PlugLayoutTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def testCustomWidgets( self ) :
self.assertTrue( isinstance( p.customWidget( "test" ), self.CustomWidget ) )
self.assertTrue( p.customWidget( "test" ).node.isSame( n ) )

Gaffer.Metadata.registerValue( n, "layout:customWidget:test:widgetType", "" )
self.assertIsNone( p.customWidget( "test") )

def testSectionQueries( self ) :

n = Gaffer.Node()
Expand Down

0 comments on commit 86c1207

Please sign in to comment.