Skip to content

Commit

Permalink
UI : Always pass a parent to PopupWindow.popup()
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Jun 27, 2024
1 parent 9f744ad commit 65725f2
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 17 deletions.
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
1.4.x.x (relative to 1.4.8.0)
=======

Fixes
-----

- OpenColorIO : Fixed the display transform used to show colours in popups.

API
---

Expand Down
8 changes: 4 additions & 4 deletions python/GafferSceneUI/LightEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def __editSelectedCells( self, pathListing, quickBoolean = True ) :
with GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) :
GafferUI.Image( "warningSmall.png" )
GafferUI.Label( "<h4>The " + column.headerData().value + " column can only be toggled for lights." )
self.__popup.popup()
self.__popup.popup( parent = self )
return

context["scene:path"] = path
Expand All @@ -416,7 +416,7 @@ def __editSelectedCells( self, pathListing, quickBoolean = True ) :
GafferUI.Image( "warningSmall.png" )
GafferUI.Label( "<h4>The selected cells cannot be edited in the current Edit Scope</h4>" )

self.__popup.popup()
self.__popup.popup( parent = self )

return

Expand All @@ -434,7 +434,7 @@ def __editSelectedCells( self, pathListing, quickBoolean = True ) :
if isinstance( self.__popup.plugValueWidget(), GafferUI.TweakPlugValueWidget ) :
self.__popup.plugValueWidget().setNameVisible( False )

self.__popup.popup()
self.__popup.popup( parent = self )

else :

Expand All @@ -443,7 +443,7 @@ def __editSelectedCells( self, pathListing, quickBoolean = True ) :
GafferUI.Image( "warningSmall.png" )
GafferUI.Label( "<h4>{}</h4>".format( nonEditable[0].nonEditableReason() ) )

self.__popup.popup()
self.__popup.popup( parent = self )

def __toggleBoolean( self, inspectors, inspections ) :

Expand Down
8 changes: 4 additions & 4 deletions python/GafferSceneUI/RenderPassEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def __setActiveRenderPass( self, pathListing ) :
GafferUI.Image( "warningSmall.png" )
GafferUI.Label( "<h4>The script is read-only.</h4>" )

self.__popup.popup()
self.__popup.popup( parent = self )
return

if "renderPass" not in script["variables"] :
Expand Down Expand Up @@ -488,7 +488,7 @@ def __editSelectedCells( self, pathListing, quickBoolean = True ) :
GafferUI.Image( "warningSmall.png" )
GafferUI.Label( "<h4>The selected cells cannot be edited in the current Edit Scope</h4>" )

self.__popup.popup()
self.__popup.popup( parent = self )

return

Expand All @@ -508,7 +508,7 @@ def __editSelectedCells( self, pathListing, quickBoolean = True ) :

## \todo : Adjust popup width based on the inspector column width(s) to improve
# editing of long paths, similar to how we handle this in the Spreadsheet.
self.__popup.popup()
self.__popup.popup( parent = self )

else :

Expand All @@ -517,7 +517,7 @@ def __editSelectedCells( self, pathListing, quickBoolean = True ) :
GafferUI.Image( "warningSmall.png" )
GafferUI.Label( "<h4>{}</h4>".format( nonEditable[0].nonEditableReason() ) )

self.__popup.popup()
self.__popup.popup( parent = self )

def __toggleBoolean( self, inspectors, inspections ) :

Expand Down
3 changes: 2 additions & 1 deletion python/GafferSceneUI/SceneViewUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ def __clicked( self, button ) :
center = imath.V2i(
bound.center().x,
bound.max().y + self.__window.bound().size().y / 2 + 8,
)
),
parent = self
)

##########################################################################
Expand Down
2 changes: 1 addition & 1 deletion python/GafferSceneUI/_HistoryWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def __editSelectedCell( self, pathListing ) :
if isinstance( self.__popup.plugValueWidget(), GafferUI.TweakPlugValueWidget ) :
self.__popup.plugValueWidget().setNameVisible( False )

self.__popup.popup()
self.__popup.popup( parent = self )

def __dragBegin( self, pathListing, event ) :

Expand Down
4 changes: 2 additions & 2 deletions python/GafferSceneUI/_SceneViewInspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def __valueDoubleClick( self, widget, event ) :
)
if isinstance( self.__popup.plugValueWidget(), GafferUI.TweakPlugValueWidget ) :
self.__popup.plugValueWidget().setNameVisible( False )
self.__popup.popup()
self.__popup.popup( parent = self )

else :

Expand All @@ -425,7 +425,7 @@ def __valueDoubleClick( self, widget, event ) :
self.__formatWarnings( [ r.nonEditableReason() for r in self.__inspectorResults ] )
) )

self.__popup.popup()
self.__popup.popup( parent = self )

return True

Expand Down
4 changes: 2 additions & 2 deletions python/GafferUI/EditScopeUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def __drop( self, widget, event ) :
with GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) :
GafferUI.Image( "warningSmall.png" )
GafferUI.Label( "<h4>The Edit Scope cannot be set while nothing is viewed</h4>" )
self.__popup.popup()
self.__popup.popup( parent = self )
elif dropNode :
upstream = Gaffer.NodeAlgo.findAllUpstream( inputNode, self.__editScopePredicate )
if self.__editScopePredicate( inputNode ) :
Expand All @@ -465,7 +465,7 @@ def __drop( self, widget, event ) :
with GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) :
GafferUI.Image( "warningSmall.png" )
GafferUI.Label( "<h4>{} cannot be used as it is not upstream of {}</h4>".format( dropNode.getName(), inputNode.getName() ) )
self.__popup.popup()
self.__popup.popup( parent = self )

self.__frame.setHighlighted( False )

Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/GraphEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def __popupNodeMenu( self ) :
GafferUI.Image( "warningSmall.png" )
GafferUI.Label( "Node Graph Not Editable" )

self.__readOnlyPopup.popup( center = self.bound().center() )
self.__readOnlyPopup.popup( center = self.bound().center(), parent = self )

def __nodeMenuVisibilityChanged( self, widget ) :

Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/SpreadsheetUI/_PlugTableView.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ def __showEditor( self, plugs, plugBound, allowDirectEditing ) :
return

self.__editorWidget = GafferUI.PlugPopup( plugs, title = "" )
self.__editorWidget.popup( plugBound.center() )
self.__editorWidget.popup( plugBound.center(), parent = self )

widget = self.__editorWidget.plugValueWidget()
if isinstance( widget, GafferUI.StringPlugValueWidget ) :
Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/VectorDataWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ def _createEditorInternal( self, index ) :
self.__colorChooser = GafferUI.ColorChooser( value )
self.__popup = GafferUI.PopupWindow( "", child = self.__colorChooser )

self.__popup.popup()
self.__popup.popup( parent = self )

return self.__popup

Expand Down

0 comments on commit 65725f2

Please sign in to comment.