From da01eab6c10a64ad3f39e9b7cfcaeb3486bb680a Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Sun, 22 Nov 2020 12:02:34 +0000 Subject: [PATCH] Grey-out CompositeView menu items if CompositeView not enabled. Thanks to Michael Danilov for explanation of how to do this. Also removed spurious hot-key text from CompositeView menu items. --- Nasal/gui.nas | 13 +++++++++++++ gui/menubar.xml | 3 --- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Nasal/gui.nas b/Nasal/gui.nas index f8fbb23ee..2c9915d5b 100644 --- a/Nasal/gui.nas +++ b/Nasal/gui.nas @@ -1534,3 +1534,16 @@ setlistener( "/sim/menubar/autovisibility/enabled", func(n) { menubarVisibility.setBoolValue(currentMenubarVisibility); } }, 1, 0); + +setlistener( + "sim/rendering/composite-viewer-enabled", + func(node) { + var cv_enabled = node.getBoolValue(); + menuEnable("view-clone", cv_enabled); + menuEnable("view-push", cv_enabled); + menuEnable("view-last-pair", cv_enabled); + menuEnable("view-last-pair-double", cv_enabled); + }, + 1, # init - trigger immediately. + 0, # type - trigger only when value changed. + ); \ No newline at end of file diff --git a/gui/menubar.xml b/gui/menubar.xml index 199fdf5e6..ccbd0a5da 100644 --- a/gui/menubar.xml +++ b/gui/menubar.xml @@ -98,7 +98,6 @@ /sim/rendering/composite-viewer-enabled view-clone - Sup-v view-clone @@ -119,7 +118,6 @@ /sim/rendering/composite-viewer-enabled view-last-pair - Sup-V view-last-pair @@ -130,7 +128,6 @@ /sim/rendering/composite-viewer-enabled view-last-pair-double - view-last-pair-double