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
* '''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
* '''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
* '''drag the time ruler horizontally''': zoom in or out with fixed start time
* '''double-click the time ruler''': reset zoom to full range
if (fDragState != DRAG_NONE) {
return;
}
if (fDragState != DRAG_NONE) {
return;
}
- boolean zoomScroll = false;
+ boolean horizontalZoom = false;
boolean horizontalScroll = 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
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
+ if ((e.stateMask & SWT.MODIFIER_MASK) == (SWT.SHIFT | SWT.CTRL)) {
+ verticalZoom = true;
+ }
} else if (e.y < 0) {
// over the time scale
} else if (e.y < 0) {
// over the time scale
} else if (e.y >= getSize().y) {
// over the horizontal scroll bar
if ((e.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) {
} else if (e.y >= getSize().y) {
// over the horizontal scroll bar
if ((e.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) {
} else {
horizontalScroll = true;
}
} else {
} 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()) {
+ horizontalZoom = false;
} else {
// over the state area
if ((e.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) {
// over the state area, CTRL pressed
} else {
// over the state area
if ((e.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) {
// over the state area, CTRL pressed
} else {
// over the state area, CTRL not pressed
} else {
// over the state area, CTRL not pressed
+ 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) {
if (e.count > 0) {
zoom(true);
} else if (e.count < 0) {