From 43cd2b0ef8ef58ac467f814382abb09df88c5a59 Mon Sep 17 00:00:00 2001 From: Johnny Chan Date: Mon, 3 Jul 2023 19:08:55 +1200 Subject: [PATCH 1/2] stylesheet fix to menu action. #351 --- NodeGraphQt/base/menu.py | 9 +++++++++ NodeGraphQt/widgets/actions.py | 5 +++++ 2 files changed, 14 insertions(+) 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/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), From 1985cd20b224c269f7c7cf9c2a540854ad55560b Mon Sep 17 00:00:00 2001 From: Johnny Chan Date: Mon, 3 Jul 2023 19:09:31 +1200 Subject: [PATCH 2/2] version bump --- NodeGraphQt/pkg_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'