Skip to content

Commit

Permalink
Menu : Add disabled Attribute
Browse files Browse the repository at this point in the history
The disabled attribute allows showing items in the menu while keeping them disabled
  • Loading branch information
chrisc-lee committed Jan 31, 2024
1 parent 38bf93a commit 0101e18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
1.2.10.x (relative to 1.2.10.5)
========

Improvements
-----

- Menu : Added ability to show disabled menu actions

1.2.10.5 (relative to 1.2.10.4)
========

Expand Down
2 changes: 1 addition & 1 deletion python/GafferUI/Menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def __buildAction( self, item, name, parent ) :

signal.connect( IECore.curry( Gaffer.WeakMethod( self.__actionTriggered ), weakref.ref( qtAction ) ) )

active = self.__evaluateItemValue( item.active )
active = self.__evaluateItemValue( item.active ) and not getattr( item, "disabled", None )
qtAction.setEnabled( active )

shortCut = getattr( item, "shortCut", None )
Expand Down

0 comments on commit 0101e18

Please sign in to comment.