Skip to content

Commit

Permalink
Used BoolWidget switch mode to improve CompoundDataPlugValueWidgets.
Browse files Browse the repository at this point in the history
Fixes #65.
  • Loading branch information
johnhaddon committed Oct 9, 2013
1 parent 2279851 commit f867bc9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions python/GafferUI/CompoundDataPlugValueWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,12 @@ def __init__( self, childPlug, label=None ) :
self.__row.append( nameWidget )

if "enabled" in childPlug :
self.__row.append( GafferUI.PlugValueWidget.create( childPlug["enabled"] ) )
self.__row.append(
GafferUI.BoolPlugValueWidget(
childPlug["enabled"],
displayMode = GafferUI.BoolWidget.DisplayMode.Switch
)
)

self.__row.append( GafferUI.PlugValueWidget.create( childPlug["value"] ), expand = True )

Expand Down Expand Up @@ -160,7 +165,9 @@ def _updateFromPlug( self ) :
with self.getContext() :
enabled = self.getPlug()["enabled"].getValue()

self.__row[0].setEnabled( enabled )
if isinstance( self.__row[0], GafferUI.StringPlugValueWidget ) :
self.__row[0].setEnabled( enabled )

self.__row[-1].setEnabled( enabled )

GafferUI.PlugValueWidget.registerType( Gaffer.CompoundDataPlug.staticTypeId(), CompoundDataPlugValueWidget )
Expand Down

0 comments on commit f867bc9

Please sign in to comment.