| Summary: | The height of the title area in TitleAreaDialog doesn't take the length of the contained message into account | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Baochuan Lin <baochlin> | ||||||||
| Component: | UI | Assignee: | Noopur Gupta <noopur_gupta> | ||||||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||||||
| Severity: | minor | ||||||||||
| Priority: | P3 | CC: | baochlin, cjxu, daniel_megert, eclipse.sprigogin, kitlo, kqli, Lars.Vogel, markus.kell.r, xbpan | ||||||||
| Version: | 4.5 | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=156790 | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
Created attachment 252708 [details]
The default panels is horizontal truncation on Linux
The bug is in TitleAreaDialog class. Line 291 of TitleAreaDialog.java reads: messageLabelHeight = messageLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT).y; This statement is incorrect since it always returns the height of a single line of text, regardless of the width of the message area. See also bug 156790. In particular http://bugs.eclipse.org/bugs/show_bug.cgi?id=156790#c14 I don't want to touch TitleAreaDialog at this point. Noopur, please take a look for 4.5.1. Created attachment 255019 [details]
Screenshot - Eclipse Mars
I don't see the truncated text issue in "Add Filter" dialog with Eclipse Mars release build using English on both Windows 7 and Ubuntu 14.04 (GTK3).
See attached screenshot.
Please let me know if this is still reproducible at your end with Mars release build.
(In reply to Noopur Gupta from comment #6) Has the issue described in comment #2 been fixed? Hi, all After check in OS: Windows7 Screen Resolution : 1600 * 900 Build ID: I20150603-2000 And OS: RHEL 7.1 GTK: GTK3 version 3.8.8 Screen Resolution : 1600 * 1200 Build ID: I20150603-2000 Problem still exist (In reply to Sergey Prigogin from comment #7) > Has the issue described in comment #2 been fixed? Line 291 of TitleAreaDialog.java has not been touched, and it's actually OK. A few lines above there is ... messageLabel.setText(" \n "); // two lines//$NON-NLS-1$ ... which ensures the label actually extends to two lines. The last bigger update to TitleAreaDialog was done in bug 16552, where it was decided to generally keep the title message short, and add a tooltip if it's still too long. IMO, that's good enough (i.e. WORKSFORME). The strange font in the Windows screenshot is probably caused by special characters used in the pseudo translations. (In reply to Dani Megert from comment #10) > The strange font in the Windows screenshot is probably caused by special > characters used in the pseudo translations. I tested with the pseudo translation and can't see the font issue on Windows. Dani was right. I don't see the truncation problem if I reset the JFace dialog font back to the default. (In reply to Markus Keller from comment #9) The height of an arbitrary two-line text is not guaranteed to be the same at the height of " \n ", is it? (In reply to Sergey Prigogin from comment #13) > The height of an arbitrary two-line text is not guaranteed to be the same at > the height of " \n ", is it? In theory, you're probably right. In practice, with well-behaved fonts and UI messages, it usually is the same. For layout stability, we need to set a constant height. There's no API to get the "maximal possible height of two lines of text", but measuring " \n " is a good approximation. (In reply to Markus Keller from comment #14) Since the current solution is already an approximation, it can be slightly improved upon by using a more representative text, for example "A\np". Another option is to introduce some extra margin by multiplying messageLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT).y by some coefficient, for example 9/8. |
Created attachment 252707 [details] The default panels are truncated on Windows Build ID: I20150320-0800 Platform: Windows and Linux Steps to reproduce: 1. Double click eclipse.exe file 2. Click Window -> Preferences 3. Click General -> Tracing -> UI Responsiveness Monitoring in left frame 4. Click Add Filter Problem Description: 1.The default Add Filter panels are truncated on Windows. 2.The default Add Filter panels are horizontal truncation in English Linux. Even though user could resize the panel but with the default truncation user might think the message is incomplete. The user experience is not friendly. Please help fix. Thanks a lot.