Skip to content

Commit

Permalink
Merge pull request #5931 from murraystevenson/editScopeWidthMetadata
Browse files Browse the repository at this point in the history
EditScopeUI : Respect `<layoutName>:width` metadata
  • Loading branch information
johnhaddon authored Jul 1, 2024
2 parents fb93e8b + 81b7b4b commit 0c06fe4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Improvements
------------

- Cryptomatte : Renamed `__manifestScene` plug to `manifestScene` so it is no longer considered to be private.
- EditScopePlugValueWidget : Width can now be configured via `<layoutName>:width` metadata. This enables customisation of the Edit Scope menu width by registering metadata in a startup file, such as `Gaffer.Metadata.registerValue( GafferSceneUI.RenderPassEditor.Settings, "editScope", "layout:width", 450 )` to double the standard width of the Edit Scope menu in the Render Pass Editor.

Fixes
-----
Expand Down
1 change: 1 addition & 0 deletions python/GafferSceneUI/LightEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ def __showHistory( self, *unused ) :
"editScope" : [

"plugValueWidget:type", "GafferUI.EditScopeUI.EditScopePlugValueWidget",
"layout:width", 225,

],

Expand Down
1 change: 1 addition & 0 deletions python/GafferSceneUI/RenderPassEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@ def __updateButtonStatus( self, *unused ) :
"editScope" : [

"plugValueWidget:type", "GafferUI.EditScopeUI.EditScopePlugValueWidget",
"layout:width", 225,

],

Expand Down
3 changes: 2 additions & 1 deletion python/GafferSceneUI/SceneViewUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ def __rendererPlugActivator( plug ) :

"editScope" : [

"toolbarLayout:index", -1,
"plugValueWidget:type", "GafferUI.EditScopeUI.EditScopePlugValueWidget",
"toolbarLayout:index", -1,
"toolbarLayout:width", 225,

],

Expand Down
4 changes: 3 additions & 1 deletion python/GafferUI/EditScopeUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

from GafferUI._StyleSheet import _styleColors
from Qt import QtGui
from Qt import QtWidgets

Gaffer.Metadata.registerNode(

Expand Down Expand Up @@ -131,7 +132,8 @@ def __init__( self, plug, **kw ) :
menu = GafferUI.Menu( Gaffer.WeakMethod( self.__menuDefinition ) ),
highlightOnOver = False
)
self.__menuButton._qtWidget().setFixedWidth( 120 )
# Ignore the width in X so MenuButton width is limited by the overall width of the widget
self.__menuButton._qtWidget().setSizePolicy( QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Fixed )
self.__navigationMenuButton = GafferUI.MenuButton(
image = "navigationArrow.png",
hasFrame = False,
Expand Down

0 comments on commit 0c06fe4

Please sign in to comment.