Skip to content

Make shortcuts use toggleModule instead of openModule

Hello @geuzaine, I stumbled across #1892 (closed) and looked into the matter.

I found that the author of #1892 (closed) probably manually interacted with the tree once and was then confused why the shortcuts no longer work. I couldn't find a reference/note of this behavior in the gmsh manual.

The problem is that isManuallyClosed will be set once the user closes the tree item manually, preventing shortcuts from opening the modules. From this point forwards, only manual opening and closing of the tree items is possible. The line of code in question is here and it was added in this commit.

To make the shortcuts feel more natural and no longer be entirely disabled upon interacting with the tree manually once, I removed the shortcuts calling openModule and instead have them call a new toggleModule function, which opens or closes the module based on its current state.

The functionality of openModule is hereby unchanged and anybody interacting with it will still get the same results. Please let me know if you have any ideas or concerns.

Heres a quick demo of how you can use the tree now.
shortcut_demo

Edited by Andreas Farley

Merge request reports