Skip to content

Commit 5975a39

Browse files
committed
Fix minor issue with mouse cursor in the command tree.
When hovering in the counter area on a row where the command in the tree portion of the view is truncated, the mouse may change to the hand cursor, when it shouldn't, as it is looking at the truncated portion of the command when determining if there's a link under the mouse cursor.
1 parent 37d7923 commit 5975a39

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

gapic/src/main/com/google/gapid/views/CommandTree.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,12 @@ private void updateHover(int ex, int ey) {
11891189
}
11901190
}
11911191

1192-
updateCursor(ex - size.tree.x + treeHBar.getSelection());
1192+
if (ex < size.tree.x || ex >= size.tree.x + size.tree.w) {
1193+
setCursor(null);
1194+
} else {
1195+
double x = ex - size.tree.x + treeHBar.getSelection();
1196+
setCursor(getFollow(x) != null ? getDisplay().getSystemCursor(SWT.CURSOR_HAND) : null);
1197+
}
11931198
}
11941199

11951200
private void checkHoveredRow() {
@@ -1237,10 +1242,6 @@ private boolean shouldShowImage(CommandStream.Node node) {
12371242
node.getData() != null && !node.getData().getGroup().isEmpty();
12381243
}
12391244

1240-
private void updateCursor(double x) {
1241-
setCursor(getFollow(x) != null ? getDisplay().getSystemCursor(SWT.CURSOR_HAND) : null);
1242-
}
1243-
12441245
@Override
12451246
public boolean setFocus() {
12461247
return forceFocus();

0 commit comments

Comments
 (0)