From 5975a3929861fbf862bb964b90668a0391afb2fd Mon Sep 17 00:00:00 2001 From: Pascal Muetschard Date: Thu, 10 Mar 2022 09:53:52 -0800 Subject: [PATCH] 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. --- .../src/main/com/google/gapid/views/CommandTree.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gapic/src/main/com/google/gapid/views/CommandTree.java b/gapic/src/main/com/google/gapid/views/CommandTree.java index 7f5576d94..2c4a84e3b 100644 --- a/gapic/src/main/com/google/gapid/views/CommandTree.java +++ b/gapic/src/main/com/google/gapid/views/CommandTree.java @@ -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() { @@ -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();