tmf: Support vertical zoom in time graph with Shift+Ctrl+Mouse Wheel
authorPatrick Tasse <patrick.tasse@gmail.com>
Fri, 11 Dec 2015 20:57:01 +0000 (15:57 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Thu, 17 Dec 2015 17:32:24 +0000 (12:32 -0500)
Change-Id: Ie5486855cd29c95ee3b0d7caad0ceac6c184d725
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/62534
Reviewed-by: Francis Giraldeau <francis.giraldeau@gmail.com>
Reviewed-by: Hudson CI
doc/org.eclipse.tracecompass.doc.user/doc/User-Guide.mediawiki
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java

index 58b2721f3e32f189def0510cfe2f0e601b40236f..98197aa63028c5ac0757fbab3b0a17bbca79ac74 100644 (file)
@@ -1605,7 +1605,8 @@ The states flow is usable with the mouse. The following actions are set:
 * '''right-drag horizontally''': [[#Zoom region|zoom region]]
 * '''click on a colored bar''': the associated process node is selected and the current time indicator is moved where the click happened
 * '''mouse wheel up/down''': scroll up or down
-* '''Ctrl-mouse wheel up/down''': zoom in or out
+* '''Ctrl-mouse wheel up/down''': zoom in or out horizontally
+* '''Shift-Ctrl-mouse wheel up/down''': zoom in or out vertically
 * '''drag the time ruler horizontally''': zoom in or out with fixed start time
 * '''double-click the time ruler''': reset zoom to full range
 
index 826259545a22f15761e98182da8d935a6dbdcee6..1d46d612937ce8e3f9c4cabf71fa8005d7d2f966 100644 (file)
@@ -2621,42 +2621,53 @@ public class TimeGraphControl extends TimeGraphBaseControl
         if (fDragState != DRAG_NONE) {
             return;
         }
-        boolean zoomScroll = false;
+        boolean horizontalZoom = false;
         boolean horizontalScroll = false;
+        boolean verticalZoom = false;
         Point p = getParent().toControl(getDisplay().getCursorLocation());
         Point parentSize = getParent().getSize();
         if (p.x >= 0 && p.x < parentSize.x && p.y >= 0 && p.y < parentSize.y) {
             // over the parent control
             if (e.x > getSize().x) {
                 // over the vertical scroll bar
-                zoomScroll = false;
+                if ((e.stateMask & SWT.MODIFIER_MASK) == (SWT.SHIFT | SWT.CTRL)) {
+                    verticalZoom = true;
+                }
             } else if (e.y < 0) {
                 // over the time scale
-                zoomScroll = true;
+                horizontalZoom = true;
             } else if (e.y >= getSize().y) {
                 // over the horizontal scroll bar
                 if ((e.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) {
-                    zoomScroll = true;
+                    horizontalZoom = true;
                 } else {
                     horizontalScroll = true;
                 }
             } else {
-                if (e.x < fTimeProvider.getNameSpace()) {
+                if ((e.stateMask & SWT.MODIFIER_MASK) == (SWT.SHIFT | SWT.CTRL)) {
+                    verticalZoom = true;
+                } else if (e.x < fTimeProvider.getNameSpace()) {
                     // over the name space
-                    zoomScroll = false;
+                    horizontalZoom = false;
                 } else {
                     // over the state area
                     if ((e.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) {
                         // over the state area, CTRL pressed
-                        zoomScroll = true;
+                        horizontalZoom = true;
                     } else {
                         // over the state area, CTRL not pressed
-                        zoomScroll = false;
+                        horizontalZoom = false;
                     }
                 }
             }
         }
-        if (zoomScroll && fTimeProvider.getTime0() != fTimeProvider.getTime1()) {
+        if (verticalZoom) {
+            if (e.count > 0) {
+                verticalZoom(true, true);
+            } else if (e.count < 0) {
+                verticalZoom(false, true);
+            }
+        } else if (horizontalZoom && fTimeProvider.getTime0() != fTimeProvider.getTime1()) {
             if (e.count > 0) {
                 zoom(true);
             } else if (e.count < 0) {
This page took 0.031504 seconds and 5 git commands to generate.