Skip to content

Commit

Permalink
MultiLineStringPlugValueWidget : Don't show activation hint unnecessa…
Browse files Browse the repository at this point in the history
…rily
  • Loading branch information
johnhaddon committed May 23, 2024
1 parent 3989262 commit 65b0b6e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions python/GafferUI/MultiLineStringPlugValueWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ def __init__( self, plug, **kw ) :
self._addPopupMenu( self.__textWidget )

self.__textWidget.keyPressSignal().connect( Gaffer.WeakMethod( self.__keyPress ), scoped = False )
self.__textWidget.editingFinishedSignal().connect( Gaffer.WeakMethod( self.__setPlugValue ), scoped = False )
self.__textChangedConnection = self.__textWidget.textChangedSignal().connect( Gaffer.WeakMethod( self.__setPlugValue ), scoped = False )

def textWidget( self ) :

Expand All @@ -78,9 +76,13 @@ def _updateFromMetadata( self ) :
role = getattr( self.__textWidget.Role, role.capitalize() ) if role else self.__textWidget.Role.Text
self.__textWidget.setRole( role )

self.__textChangedConnection.setBlocked(
not Gaffer.Metadata.value( self.getPlug(), "multiLineStringPlugValueWidget:continuousUpdate" )
)
# We don't connect to `editingFinishedSignal()` when we're in continuous mode, as otherwise the
# text widget would show an unnecessary "activation hint" overlay.
if Gaffer.Metadata.value( self.getPlug(), "multiLineStringPlugValueWidget:continuousUpdate" ) :
textEditedSignal = self.__textWidget.textChangedSignal()
else :
textEditedSignal = self.__textWidget.editingFinishedSignal()
self.__textEditedConnection = textEditedSignal.connect( Gaffer.WeakMethod( self.__setPlugValue ), scoped = True )

def _updateFromEditable( self ) :

Expand Down

0 comments on commit 65b0b6e

Please sign in to comment.