Merge branch 'development' of https://gitlab.lrz.de/lrr-tum/students/eragp-misim...
[Mograsim.git] / plugins / net.mograsim.logic.model / src / net / mograsim / logic / model / LogicUICanvas.java
index 50e6471..162e002 100644 (file)
@@ -63,7 +63,7 @@ public class LogicUICanvas extends ZoomableCanvas
 
        private void mouseDown(Event e)
        {
-               if (e.button == 1)
+               if (e.button == Preferences.current().getInt("net.mograsim.logic.model.button.action"))
                {
                        Point click = canvasToWorldCoords(e.x, e.y);
                        for (ModelComponent component : model.getComponentsByName().values())
@@ -164,6 +164,7 @@ public class LogicUICanvas extends ZoomableCanvas
                get.addListener(SWT.Selection, getAction);
                stateIDText.addListener(SWT.DefaultSelection, getAction);
                debugShell.open();
+               addDisposeListener(e -> debugShell.dispose());
        }
 
        private void compsChanged(Consumer<? super ModelComponent> compAdded, Consumer<? super ModelComponent> compRemoved, ModelComponent c,
@@ -216,7 +217,7 @@ public class LogicUICanvas extends ZoomableCanvas
                componentsByItemIndex.clear();
                componentSelector.setItems();
                addComponentSelectorItems(componentsByItemIndex, "", componentSelector, model,
-                               Preferences.current().getInt("net.mograsim.logic.model.debug.hlsshelldepth"));
+                               Preferences.current().getInt("net.mograsim.logic.model.debug.hlsshelldepth") - 1);
        }
 
        private void addComponentSelectorItems(List<ModelComponent> componentsByItemIndex, String base, Combo componentSelector,