]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Allow property editing with just a single mouse click 78/3678/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Thu, 5 Dec 2019 11:56:16 +0000 (13:56 +0200)
committerReino Ruusu <reino.ruusu@semantum.fi>
Thu, 5 Dec 2019 11:58:32 +0000 (13:58 +0200)
gitlab #62

Change-Id: Idcbc1644787316cced9d90481d44759fd754325a

org.simantics.g3d/src/org/simantics/g3d/property/AnnotatedPropertyTabContributorFactory.java

index 15b787d6d91781b8177e5b824c71eb4860cd611d..3fcb19f5e21f62fe11b9ab028e6ce6ce62f35bc4 100644 (file)
@@ -599,23 +599,12 @@ public class AnnotatedPropertyTabContributorFactory implements PropertyTabContri
                        }
                        ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(
                                        viewer) {
-                               Object lastSource = null;
-                               int clickCount = 0;
-                               
                                protected boolean isEditorActivationEvent(
                                                ColumnViewerEditorActivationEvent event) {
-                                       if (!event.getSource().equals(lastSource))
-                                               clickCount = 0;
-                                       
-                                       lastSource = event.getSource();
-                                       
-                                       if (event.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION)
-                                               clickCount += 1;
-                                               
                                        return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
+                                                       || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION
                                                        || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
-                                                       || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION && clickCount >= 2
-                                                       || (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR)
+                                                       || (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && (event.keyCode == SWT.CR || event.keyCode == SWT.F2))
                                                        || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
                                }
                        };