diff --git a/Changes.md b/Changes.md index 73689a7a245..129607e90a0 100644 --- a/Changes.md +++ b/Changes.md @@ -30,6 +30,7 @@ Fixes - Display : Fixed shutdown crashes caused by Python slots connected to `driverCreatedSignal()` and `imageReceivedSignal()` [^1]. - LightPositionTool : Fixed crash when changing the tool mode with nothing selected [^1]. - ViewportGadget : Fixed selection issues with Intel GPUs (#901, #2788). +- TransformTool : Fixed alignment of green "value changed" icon for `orientation` plugs. API --- @@ -39,6 +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 `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 ---------------- diff --git a/python/GafferUI/LabelPlugValueWidget.py b/python/GafferUI/LabelPlugValueWidget.py index d3eab7fa4f6..f412ba43d62 100644 --- a/python/GafferUI/LabelPlugValueWidget.py +++ b/python/GafferUI/LabelPlugValueWidget.py @@ -45,6 +45,8 @@ # Supported plug metadata : # # - "renameable" +# - "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 ) : ## \todo Remove alignment arguments. Vertically the only alignment that looks good is `Center`, and @@ -72,6 +74,17 @@ def __init__( self, plug, horizontalAlignment=GafferUI.Label.HorizontalAlignment self.__label._qtWidget().setFixedHeight( 20 ) layout.addWidget( self.__label._qtWidget() ) + self.__label._qtWidget().setProperty( + "gafferShowValueChangedIndicator", + all( + ( + p.direction() == Gaffer.Plug.Direction.In and + Gaffer.Metadata.value( p, "labelPlugValueWidget:showValueChangedIndicator" ) != False + ) + for p in self.getPlugs() + ) + ) + self.__editableLabel = None # we'll make this lazily as needed # Connecting at front so we're called before the slots diff --git a/python/GafferUI/SplinePlugValueWidget.py b/python/GafferUI/SplinePlugValueWidget.py index 187b05df86a..25300fd57cd 100644 --- a/python/GafferUI/SplinePlugValueWidget.py +++ b/python/GafferUI/SplinePlugValueWidget.py @@ -98,6 +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", "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 diff --git a/python/GafferUI/_StyleSheet.py b/python/GafferUI/_StyleSheet.py index 23bf1e5ea63..5bd7f6ad27c 100644 --- a/python/GafferUI/_StyleSheet.py +++ b/python/GafferUI/_StyleSheet.py @@ -239,21 +239,18 @@ def styleColor( key ) : color: #b0d8fb; } - QLabel#gafferPlugLabel { + QLabel#gafferPlugLabel[gafferShowValueChangedIndicator="true"] { /* - QLabel's text layout seems to lurch from one approach - to another in the presence of non-zero padding. So we - need some padding here so that we get a layout that - matches the `gafferValueChanged="true"` styling below. + Ensure that there is enough space reserved for the `valueChanged` + icon whether it is visible or not. */ - padding-left: 1px; + padding-left: 10px; } - QLabel#gafferPlugLabel[gafferValueChanged="true"] { + QLabel#gafferPlugLabel[gafferShowValueChangedIndicator="true"][gafferValueChanged="true"] { background-image: url(:/valueChanged.png); background-repeat: no-repeat; background-position: left; - padding-left: 16px; } QLabel#gafferDefaultRowLabel { diff --git a/resources/graphics.svg b/resources/graphics.svg index 26a72465dd5..d28532bb367 100644 --- a/resources/graphics.svg +++ b/resources/graphics.svg @@ -3309,6 +3309,14 @@ style="display:inline;opacity:0.1;fill:none;fill-opacity:1;stroke:none;stroke-width:0.597614;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.10173;stroke-opacity:1;paint-order:markers stroke fill" inkscape:label="activeRenderPassFadedHighlightedIcon" /> + -