Skip to content

Commit

Permalink
Merge pull request #5516 from johnhaddon/plugLayoutFix
Browse files Browse the repository at this point in the history
PlugLayout : Update layout when custom widget metadata changes
  • Loading branch information
johnhaddon authored Nov 1, 2023
2 parents d741d4d + 86c1207 commit cc72bf9
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 @@ -23,6 +23,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.

API
---
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 cc72bf9

Please sign in to comment.