Skip to content

Commit

Permalink
RampPlugValueWidget : Label and value on same line
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmehl committed Mar 25, 2024
1 parent 496b53e commit 91438b3
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions python/GafferUI/RampPlugValueWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,32 @@ def __init__( self, plug, **kw ) :
spacing = 4
) :

self.__positionLabel = GafferUI.LabelPlugValueWidget(
plug.pointXPlug( 0 ),
parenting = { "verticalAlignment" : GafferUI.VerticalAlignment.Top }
)
self.__positionField = GafferUI.NumericPlugValueWidget(
plug.pointXPlug( 0 ),
parenting = { "verticalAlignment" : GafferUI.VerticalAlignment.Top }
)

self.__valueLabel = GafferUI.LabelPlugValueWidget(
plug.pointYPlug( 0 ),
parenting = { "verticalAlignment" : GafferUI.VerticalAlignment.Top }
)
if isinstance( plug.pointYPlug( 0 ), Gaffer.FloatPlug ):
self.__valueField = GafferUI.NumericPlugValueWidget(
plug.pointYPlug( 0 ),
with GafferUI.ListContainer( orientation = GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) :
self.__positionLabel = GafferUI.LabelPlugValueWidget(
plug.pointXPlug( 0 ),
parenting = { "verticalAlignment" : GafferUI.VerticalAlignment.Top }
)
self.__positionField = GafferUI.NumericPlugValueWidget(
plug.pointXPlug( 0 ),
parenting = { "verticalAlignment" : GafferUI.VerticalAlignment.Top }
)
else:
self.__valueField = GafferUI.ColorPlugValueWidget(

with GafferUI.ListContainer( orientation = GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) :
self.__valueLabel = GafferUI.LabelPlugValueWidget(
plug.pointYPlug( 0 ),
parenting = { "verticalAlignment" : GafferUI.VerticalAlignment.Top }
)
self.__valueField.setColorChooserVisible( True )
if isinstance( plug.pointYPlug( 0 ), Gaffer.FloatPlug ):
self.__valueField = GafferUI.NumericPlugValueWidget(
plug.pointYPlug( 0 ),
parenting = { "verticalAlignment" : GafferUI.VerticalAlignment.Top }
)
else:
self.__valueField = GafferUI.ColorPlugValueWidget(
plug.pointYPlug( 0 ),
parenting = { "verticalAlignment" : GafferUI.VerticalAlignment.Top }
)
self.__valueField.setColorChooserVisible( True )

self.setPlug( plug )

Expand Down

0 comments on commit 91438b3

Please sign in to comment.