Skip to content

Commit

Permalink
Fix minor issue with mouse cursor in the command tree.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pmuetschard committed Mar 14, 2022
1 parent 37d7923 commit 5975a39
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gapic/src/main/com/google/gapid/views/CommandTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,12 @@ private void updateHover(int ex, int ey) {
}
}

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

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

private void updateCursor(double x) {
setCursor(getFollow(x) != null ? getDisplay().getSystemCursor(SWT.CURSOR_HAND) : null);
}

@Override
public boolean setFocus() {
return forceFocus();
Expand Down

0 comments on commit 5975a39

Please sign in to comment.