Skip to content

Commit

Permalink
SetEditor : Add toolTips to filter widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
murraystevenson committed Dec 7, 2023
1 parent 2b16e77 commit 6f420e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/GafferSceneUI/SetEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ def __init__( self, scriptNode, **kw ) :

searchFilter = _GafferSceneUI._SetEditor.SearchFilter()
emptySetFilter = _GafferSceneUI._SetEditor.EmptySetFilter()
emptySetFilter.userData()["UI"] = { "label" : "Hide Empty" }
emptySetFilter.userData()["UI"] = { "label" : "Hide Empty", "toolTip" : "Hide sets with no members" }
emptySetFilter.setEnabled( False )

emptySelectionFilter = _GafferSceneUI._SetEditor.EmptySetFilter( propertyName = "setPath:selectedMemberCount" )
emptySelectionFilter.userData()["UI"] = { "label" : "Hide Empty Selection" }
emptySelectionFilter.userData()["UI"] = { "label" : "Hide Empty Selection", "toolTip" : "Hide sets with no selected members" }
emptySelectionFilter.setEnabled( False )

self.__filter = Gaffer.CompoundPathFilter( [ searchFilter, emptySetFilter, emptySelectionFilter ] )
Expand Down
5 changes: 5 additions & 0 deletions python/GafferUI/PathFilterWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ def _updateFromPathFilter( self ) :
invertEnabled = self.pathFilter().userData()["UI"]["invertEnabled"].value
self.__checkBox.setState( self.pathFilter().getEnabled() is not invertEnabled )

toolTip = ""
with IECore.IgnoredExceptions( KeyError ) :
toolTip = self.pathFilter().userData()["UI"]["toolTip"].value
self.__checkBox.setToolTip( toolTip )

def __stateChanged( self, checkBox ) :

invertEnabled = False
Expand Down

0 comments on commit 6f420e0

Please sign in to comment.