Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and alternates for #5737 #5764

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,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
---
Expand Down
8 changes: 8 additions & 0 deletions python/GafferUI/LabelPlugValueWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ 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
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
Expand Down
17 changes: 8 additions & 9 deletions python/GafferUI/RampPlugValueWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,19 @@ def __init__( self, plug, **kw ) :
spacing = 4
) :

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

self.__valueLabel = GafferUI.LabelPlugValueWidget(
self.__valueLabel = GafferUI.NameLabel(
plug.pointYPlug( 0 ),
formatter = lambda _ : "Value",
parenting = { "verticalAlignment" : GafferUI.VerticalAlignment.Top }
)
if isinstance( plug.pointYPlug( 0 ), Gaffer.FloatPlug ):
Expand Down Expand Up @@ -211,20 +213,17 @@ def __selectedIndexChanged( self, slider ) :
index = slider.getSelectedIndex()
if self.getPlug() is not None and index is not None :
pointPlug = self.getPlug().pointPlug( index )
self.__positionLabel.setPlug( pointPlug["x"] )
self.__positionLabel.setGraphComponent( pointPlug["x"] )
self.__positionField.setPlug( pointPlug["x"] )
self.__valueLabel.setPlug( pointPlug["y"] )
self.__valueLabel.setGraphComponent( pointPlug["y"] )
self.__valueField.setPlug( pointPlug["y"] )

else :
self.__positionLabel.setPlug( None )
self.__positionLabel.setGraphComponent( None )
self.__positionField.setPlug( None )
self.__valueLabel.setPlug( None )
self.__valueLabel.setGraphComponent( None )
self.__valueField.setPlug( None )

self.__positionLabel.label().setText( "Position" )
self.__valueLabel.label().setText( "Value" )

# we don't register this automatically for any plugs, as it takes up a lot of room
# in the node editor. this means the SplinePlugValueWidget will be used instead, and
# that will launch a dialogue containing a RampPlugValueWidget when appropriate. for
Expand Down
13 changes: 5 additions & 8 deletions python/GafferUI/_StyleSheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
20 changes: 10 additions & 10 deletions resources/graphics.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading