Bug 257903 - [Contributions] ToolTip on the ToolBar and Menu Visibility tabs of Customize Perspective Dialog should be better placed or appear after a delay.
Summary: [Contributions] ToolTip on the ToolBar and Menu Visibility tabs of Customize ...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Matthew Bisson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 182714
  Show dependency tree
 
Reported: 2008-12-08 06:00 EST by Hitesh CLA
Modified: 2009-02-18 18:03 EST (History)
5 users (show)

See Also:


Attachments
Fix (1.70 KB, patch)
2008-12-09 14:54 EST, Matthew Bisson CLA
no flags Details | Diff
Fix2 (1.43 KB, patch)
2008-12-10 06:24 EST, Markus Keller CLA
no flags Details | Diff
Avoid tooltip recreate while in cell and position tooltip at the bottom of the cell (3.84 KB, patch)
2008-12-10 12:23 EST, Thomas Schindl CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hitesh CLA 2008-12-08 06:00:27 EST
Build ID: N20081206-2000

Steps To Reproduce:
1.Navigate to Menu:Window->Customize Perspective... 
2.Try selecting/deselecting an item on ToolBar or Menu Visibility tab

The tooltip appears almost immediately, its position is right under the mouse pointer, and does not hide until the mouse is moved . This  makes it  very difficult to change the selections of the checkboxes. The tooltip must be offset a little or perhaps show up after a certain delay.
Comment 1 Matthew Bisson CLA 2008-12-08 09:10:53 EST
The current offset of the tooltip is necessary to allow users to click on links within it - if the cursor is not directly overtop, when it is moved the tooltip is hidden before the cursor reaches it. 

It seems we'll either have to delay the tooltip, or cause it not to appear over the check box (or if the cursor's over the check box, delaying slightly).
Comment 2 Markus Keller CLA 2008-12-08 09:29:59 EST
> The current offset of the tooltip is necessary to allow users to click on links
> within it - if the cursor is not directly overtop, when it is moved the tooltip
> is hidden before the cursor reaches it. 

Sounds like a severe limitation of the JFace ToolTip. Please file a bug to make sure this gets fixed in the framework.

For M4, you could get away with a solution that just does not show the tooltip over the checkbox area. But in the final solution, the mouse cursor should not cover the tool tip initially (no matter how long the delay is).
Comment 3 Matthew Bisson CLA 2008-12-08 17:03:21 EST
Bug 257986 created with patch. If it goes through, the fix for the CPD is just to invoke the new method once instead of shifting the tooltip:

currently in the ItemDetailToolTip constructor on line 853, replace

    this.setShift(new Point(-5, -5));

with

    this.setAllowCursorToEnter(true);

This would fix the current problem and the problem I described in Comment #1.
Comment 4 Matthew Bisson CLA 2008-12-09 14:54:52 EST
Created attachment 119954 [details]
Fix

It turns out that the bug I posted in my last comment is unneeded, there is already functionality built into ToolTip to do what we need - namely the constant ToolTip#NO_RECREATE. 

This patch has the proposed fix - it uses ToolTip#NO_RECREATE so the tooltip does not need to be over the cursor for the cursor to enter it to manipulate widgets. In fact, we've moved the tooltip farther down and right to prevent obscuring the tree item at all. Previously, the shift has been (-5, -5) which caused the tooltip to appear under the cursor, now it's (10, 10) to give plenty of clearance.
Comment 5 Matthew Bisson CLA 2008-12-09 15:38:11 EST
It turns out the fix I describe above is insufficient - when the user moves the cursor, the tooltip does not go away. I'm readding Bug 257986 as blocking this bug and am working with Tom Schindl to get this fixed.

Note that the patch above is no longer valid.
Comment 6 Matthew Bisson CLA 2008-12-09 15:45:41 EST
While we work on supplementing the tooltip, I recommend this intermediate fix: 

In the CustomizePerspectiveDialog in the constructor of ItemDetailToolTip, line 853, change the amount we offset the dialog:

Change

     this.setShift(new Point(-5, -5));

to

     this.setShift(new Point(0, 0));

This doesn't fix the overall problem of the tooltip blocking the user from clicking, but the user only need move his cursor one pixel up or to the left to click the checkbox, which is better than the current 6 pixels.
Comment 7 Eric Moffatt CLA 2008-12-09 16:29:57 EST
Committed in >20081209. Changed the offset to (-1,-1) to leave more 'open' room to click the check box. I'd occasionally lose the TTip when I had it set to (0,0), I'd 'jitter' the mouse a pixel up when i started moving to the right...
Comment 8 Markus Keller CLA 2008-12-10 06:24:16 EST
Created attachment 120027 [details]
Fix2

Why don't you use NO_RECREATE and override ToolTip#getToolTipArea(Event) to ensure the tooltip goes away when the cursor leaves the hovered item? This works fine in ColumnViewerToolTipSupport, and it would also allow to place the tooltip a few pixels to the right of the cursor (to avoid click-interference and overlapping the checkbox).
Comment 9 Kevin McGuire CLA 2008-12-10 11:48:21 EST
(In reply to comment #7)
> Committed in >20081209. 

Just a note that this change is going into the M4 candidate milestone build.
Comment 10 Thomas Schindl CLA 2008-12-10 12:23:28 EST
Created attachment 120078 [details]
Avoid tooltip recreate while in cell and position tooltip at the bottom of the cell
Comment 11 Eric Moffatt CLA 2008-12-10 12:34:30 EST
Committed in >20081210. Applied Tom's patch. I'll mark this one as fixed, Tom is going to take a look to see if the Tooltip can make this simpler post-M4.
Comment 12 Eric Moffatt CLA 2008-12-12 12:23:23 EST
Verified in I20081210-1800.