Bug 576680 - Owner-drawn Table/Tree: provide flag for drawing rollover tooltip
Summary: Owner-drawn Table/Tree: provide flag for drawing rollover tooltip
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.22   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-17 09:43 EDT by Thomas Singer CLA
Modified: 2021-10-18 09:54 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Singer CLA 2021-10-17 09:43:57 EDT
If a table cell is too short or a tree cell wider than the visible area, Windows draws a "tooltip" for the whole content. Side note: a selected cell is drawn unselected. From the flags that are passed to the EraseItem or PaintItem event listener it is not clear at all whether the cell is painted in the tree/table or in the tooltip/overlay. My request is to add such a flag.
Comment 1 Thomas Wolf CLA 2021-10-17 10:10:42 EDT
I ran into this in the EGit StagingView recently. See [1].

My findings were that the GC in the paint listener is clipped when drawing in the table, and is not clipped when drawing in that native hover. So I used

  tree.addListener(SWT.PaintItem, event -> {
    boolean inHover = !event.gc.isClipped();
    // Do whatever needs to be done, depending on inHover
  }

[1] https://git.eclipse.org/r/c/egit/egit/+/182394
Comment 2 Thomas Singer CLA 2021-10-18 08:39:12 EDT
Hi Thomas,

Thanks for this hint. It looks like this rollover tooltip only exists on Windows, so it probably makes not much sense to implement that globally.
Comment 3 Thomas Wolf CLA 2021-10-18 09:40:30 EDT
On OS X there is such a hover, too.
Comment 4 Thomas Singer CLA 2021-10-18 09:54:01 EDT
Err, you are right. I was not waiting long enough.