Skip to content

Commit 43cd2b0

Browse files
committed
stylesheet fix to menu action. #351
1 parent 1c49c36 commit 43cd2b0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

NodeGraphQt/base/menu.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,15 @@ def run_command(self):
295295
"""
296296
self.qaction.trigger()
297297

298+
def set_enabled(self, state):
299+
"""
300+
Sets the command to either be enabled or disabled.
301+
302+
Args:
303+
state (bool): true to enable.
304+
"""
305+
self.qaction.setEnabled(state)
306+
298307
def show(self):
299308
"""
300309
Set the command to be visible in the context menu.

NodeGraphQt/widgets/actions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ def __init__(self, *args, **kwargs):
3030
'background-color': 'rgba({0},{1},{2},200)'
3131
.format(*selected_color),
3232
},
33+
'QMenu::item:disabled': {
34+
'color': 'rgba({0},{1},{2},60)'.format(*text_color),
35+
'background-color': 'rgba({0},{1},{2},200)'
36+
.format(*ViewerEnum.BACKGROUND_COLOR.value),
37+
},
3338
'QMenu::separator': {
3439
'height': '1px',
3540
'background': 'rgba({0},{1},{2}, 50)'.format(*text_color),

0 commit comments

Comments
 (0)