diff --git a/NodeGraphQt/base/menu.py b/NodeGraphQt/base/menu.py index b1286547..d2ff8cf6 100644 --- a/NodeGraphQt/base/menu.py +++ b/NodeGraphQt/base/menu.py @@ -295,6 +295,15 @@ def run_command(self): """ self.qaction.trigger() + def set_enabled(self, state): + """ + Sets the command to either be enabled or disabled. + + Args: + state (bool): true to enable. + """ + self.qaction.setEnabled(state) + def show(self): """ Set the command to be visible in the context menu. diff --git a/NodeGraphQt/pkg_info.py b/NodeGraphQt/pkg_info.py index 77e085f6..05c6a89e 100644 --- a/NodeGraphQt/pkg_info.py +++ b/NodeGraphQt/pkg_info.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -__version__ = '0.6.5' +__version__ = '0.6.6' __status__ = 'Work in Progress' __license__ = 'MIT' diff --git a/NodeGraphQt/widgets/actions.py b/NodeGraphQt/widgets/actions.py index 4af371eb..34d07972 100644 --- a/NodeGraphQt/widgets/actions.py +++ b/NodeGraphQt/widgets/actions.py @@ -30,6 +30,11 @@ def __init__(self, *args, **kwargs): 'background-color': 'rgba({0},{1},{2},200)' .format(*selected_color), }, + 'QMenu::item:disabled': { + 'color': 'rgba({0},{1},{2},60)'.format(*text_color), + 'background-color': 'rgba({0},{1},{2},200)' + .format(*ViewerEnum.BACKGROUND_COLOR.value), + }, 'QMenu::separator': { 'height': '1px', 'background': 'rgba({0},{1},{2}, 50)'.format(*text_color),