-
Notifications
You must be signed in to change notification settings - Fork 187
Tree.java: correctly escape & in default Tooltip #801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
This bug might also exist in GTK- or Cocoa-based implementations. I suspect that they have similar fixes. |
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
Outdated
Show resolved
Hide resolved
|
Is that the right place to be changing the contents of the tooltip string? Something tells me that it's not, and perhaps ampersand escaping should be done further up the stack, or by the client. |
b78e8db to
925be9e
Compare
|
@Phillipus Escaping the |
Yeah, I can see the problem. It's just that when I look at the Is this also happening on Mac and Linux? Edit - it's OK on Mac. |
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
Outdated
Show resolved
Hide resolved
925be9e to
18a56fc
Compare
This fixes eclipse-platform/eclipse.platform.ui#1075 When TreeColumn's are too small, a ToolTip is displayed on hover to reveal the whole Label of an Item (The WIN32-Docs call them 'Inline ToolTips'). These ToolTips pass through the Composite-ToolTipText-generator which escapes all & in a Text - allowing to reuse Text from Buttons as Tooltips. This is a well documented Feature of setToolTipText. Since TreeItem's Label does not have Mnemonics, we do not assume that the & needs escaping. This Commit Escapes all & in default Tooltips that are handled by the default mechanism.
18a56fc to
340306e
Compare
Fix for
eclipse-platform/eclipse.platform.ui#238
eclipse-platform/eclipse.platform.ui#1075
When TreeColumn's are too small, a ToolTip is displayed on hover to reveal the whole Label of an Item (The WIN32-Docs call them In-Place Tooltips).
These ToolTips pass through the Composite-ToolTipText-generator which escapes all & in a Text - allowing to reuse Text from Buttons as Tooltips. This is a well documented Feature of setToolTipText. Since TreeItem's Label does not have Mnemonics, we do not assume that the & should require escaping by the User.
This Commit Escapes all & in default Tooltips that are handled by the default mechanism.