Skip to content

Commit

Permalink
fixup! RampPlugValueWidget : Label and value on same line
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmehl committed Mar 28, 2024
1 parent 0aedb34 commit aa3eeab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/GafferUI/RampPlugValueWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def __init__( self, plug, **kw ) :
self.__lastPositionChangedReason = None
self.__positionsMergeGroupId = 0

labelWidth = 50

with GafferUI.ListContainer(
orientation = GafferUI.ListContainer.Orientation.Horizontal if isinstance( plug.pointYPlug( 0 ), Gaffer.FloatPlug ) else GafferUI.ListContainer.Orientation.Vertical,
spacing = 4
Expand All @@ -86,8 +88,10 @@ def __init__( self, plug, **kw ) :
with GafferUI.ListContainer( orientation = GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) :
self.__positionLabel = GafferUI.LabelPlugValueWidget(
plug.pointXPlug( 0 ),
horizontalAlignment = GafferUI.HorizontalAlignment.Right,
parenting = { "verticalAlignment" : GafferUI.VerticalAlignment.Top }
)
self.__positionLabel.label()._qtWidget().setFixedWidth( labelWidth )
self.__positionField = GafferUI.NumericPlugValueWidget(
plug.pointXPlug( 0 ),
parenting = { "verticalAlignment" : GafferUI.VerticalAlignment.Top }
Expand All @@ -96,8 +100,10 @@ def __init__( self, plug, **kw ) :
with GafferUI.ListContainer( orientation = GafferUI.ListContainer.Orientation.Horizontal, spacing = 4 ) :
self.__valueLabel = GafferUI.LabelPlugValueWidget(
plug.pointYPlug( 0 ),
horizontalAlignment = GafferUI.HorizontalAlignment.Right,
parenting = { "verticalAlignment" : GafferUI.VerticalAlignment.Top }
)
self.__valueLabel.label()._qtWidget().setFixedWidth( labelWidth )
if isinstance( plug.pointYPlug( 0 ), Gaffer.FloatPlug ):
self.__valueField = GafferUI.NumericPlugValueWidget(
plug.pointYPlug( 0 ),
Expand Down

0 comments on commit aa3eeab

Please sign in to comment.