Skip to content

Commit

Permalink
LabelPlugValueWidget : Add prefix for widget-specific metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon authored and ericmehl committed Apr 3, 2024
1 parent 8a0181e commit e36cc50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ API
- ProcessorWidget provides a base class for custom widgets, and a factory mechanism for registering them against processors.
- SimpleProcessorWidget provides a base class for widgets with a simple summary label and optional action links.
- TractorDispatcher : The `preSpoolSignal()` now provides an additional `taskData` argument to slots, which maps from Tractor tasks to information about the Gaffer tasks they will execute.
- LabelPlugValueWidget : Added optional `showValueChangedIndicator` metadata entry. If a plug has this entry set to `False`, the icon next to the label that indicates the value has changed will not be shown. Defaults to `True` if the value is not set.
- LabelPlugValueWidget : Added optional `labelPlugValueWidget:showValueChangedIndicator` metadata entry. If a plug has this entry set to `False`, the icon next to the label that indicates the value has changed will not be shown. Defaults to `True` if the value is not set.

Breaking Changes
----------------
Expand Down
4 changes: 2 additions & 2 deletions python/GafferUI/LabelPlugValueWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# Supported plug metadata :
#
# - "renameable"
# - "showValueChangedIndicator" : If `False`, the indicator that the
# - "labelPlugValueWidget:showValueChangedIndicator" : If `False`, the indicator that the
# plug value has changed will not be shown. Defaults to `True` if not set.
class LabelPlugValueWidget( GafferUI.PlugValueWidget ) :

Expand Down Expand Up @@ -79,7 +79,7 @@ def __init__( self, plug, horizontalAlignment=GafferUI.Label.HorizontalAlignment
all(
(
p.direction() == Gaffer.Plug.Direction.In and
Gaffer.Metadata.value( p, "showValueChangedIndicator" ) != False
Gaffer.Metadata.value( p, "labelPlugValueWidget:showValueChangedIndicator" ) != False
)
for p in self.getPlugs()
)
Expand Down
4 changes: 2 additions & 2 deletions python/GafferUI/SplinePlugValueWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def __buttonPress( self, button, event ) :
Gaffer.Metadata.registerValue( plugType, "interpolation", "plugValueWidget:type", "GafferUI.PresetsPlugValueWidget" )
for name, value in sorted( Gaffer.SplineDefinitionInterpolation.names.items() ):
Gaffer.Metadata.registerValue( plugType, "interpolation", "preset:" + name, value )
Gaffer.Metadata.registerValue( plugType, "p[0-9]*.x", "showValueChangedIndicator", False )
Gaffer.Metadata.registerValue( plugType, "p[0-9]*.y", "showValueChangedIndicator", False )
Gaffer.Metadata.registerValue( plugType, "p[0-9]*.x", "labelPlugValueWidget:showValueChangedIndicator", False )
Gaffer.Metadata.registerValue( plugType, "p[0-9]*.y", "labelPlugValueWidget:showValueChangedIndicator", False )

## \todo See comments for `ColorSwatchPlugValueWidget._ColorPlugValueDialogue`.
# I think the best approach is probably to move the `acquire()` mechanism to the
Expand Down

0 comments on commit e36cc50

Please sign in to comment.