1
0
Fork 0

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.
This commit is contained in:
Julian Smith 2020-11-22 12:02:34 +00:00
parent 5512934374
commit da01eab6c1
2 changed files with 13 additions and 3 deletions

View file

@ -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.
);

View file

@ -98,7 +98,6 @@
<property>/sim/rendering/composite-viewer-enabled</property>
</enable>
<name>view-clone</name>
<key>Sup-v</key>
<binding>
<command>view-clone</command>
</binding>
@ -119,7 +118,6 @@
<property>/sim/rendering/composite-viewer-enabled</property>
</enable>
<name>view-last-pair</name>
<key>Sup-V</key>
<binding>
<command>view-last-pair</command>
</binding>
@ -130,7 +128,6 @@
<property>/sim/rendering/composite-viewer-enabled</property>
</enable>
<name>view-last-pair-double</name>
<key></key>
<binding>
<command>view-last-pair-double</command>
</binding>