Bug 284177 - Button text in Builders Property page are cut off in many other languages
Summary: Button text in Builders Property page are cut off in many other languages
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.4.2   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-21 15:06 EDT by George Comninos CLA
Modified: 2019-09-06 16:11 EDT (History)
2 users (show)

See Also:


Attachments
German screenshot (61.34 KB, image/png)
2009-07-21 17:29 EDT, George Comninos CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description George Comninos CLA 2009-07-21 15:06:20 EDT
Build ID: M20090211-1700

Steps To Reproduce:
1. Install Eclipse language packs and launch Eclipse in German
2. In any project , go to Builders Property Page
3. Look at the buttons on the far right

Button text is cut off. Also occurs with several other languages.

More information:
The problem appears to be the IDialogConstants.BUTTON_WIDTH which is passed into convertHorizontalDLUsToPixels(), whose value it uses as the widthHint. That value may work for English text but not for other languages.
Comment 1 Remy Suen CLA 2009-07-21 15:50:08 EDT
Can you attach a screenshot? Does this occur with 3.5?
Comment 2 George Comninos CLA 2009-07-21 17:29:12 EDT
Created attachment 142191 [details]
German screenshot

Attached screenshot of German Eclipse.
Comment 3 Francis Upton IV CLA 2009-07-22 11:08:04 EDT
Here is some conversation about what this might be; the interesting part is very near the end.  I think that the GridData.minimumWidth (instead of the widthHint) should be set to the preferred size of the button to prevent it from being shortened.

---
(07:39:07 AM) rcjsuen: krbarnes: What do you think about https://bugs.eclipse.org/bugs/attachment.cgi?id=142191
(07:39:22 AM) rcjsuen: The widthHint is -> data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
(07:39:41 AM) rcjsuen: Which may be the culprit, I don't know why computeSize wouldn't give a proper size though.
(07:41:05 AM) krbarnes: it's probably the layout... that width hint seems like it would be ok though.
(07:41:13 AM) krbarnes: it's a max after all.
(07:41:51 AM) rcjsuen: krbarnes: this is the code http://pastebin.ca/1503268
(07:42:56 AM) Francis Upton: krbarnes: I don't think it's the layout, that is to say, it's not GridLayout (I have been through that code a lot)
(07:43:24 AM) Francis Upton: I think it's an SWT issue then, the button should be able to return a value based on it's text that fits
(07:43:59 AM) toulmean [n=antoine@jau76-1-82-236-53-47.fbx.proxad.net] entered the room.
(07:44:17 AM) borisb6i [n=bbokowsk@nat/ibm/x-beae017c15f6b07c] entered the room.
(07:44:46 AM) krbarnes: it could be... I don't see the problem with that code right now.
(07:46:55 AM) Francis Upton: krbarnes: what else could it be?
(07:46:56 AM) krbarnes: rcjsuen: does setFont get called after this?
(07:47:09 AM) rcjsuen: and this guy's on 3.4.2
(07:47:12 AM) rcjsuen: i guess not a Cocoa problem
(07:47:19 AM) rcjsuen: hang on i'm on the phone with my dad
(07:47:45 AM) Francis Upton: krbarnes: nope, it's called before and not after
(07:48:41 AM) Francis Upton: krbarnes: maybe you are right about the layout, it's likely shrinking it to make it small enough to fit the dialog
(07:50:52 AM) Francis Upton: krbarnes: (I wrote an alternate version of GridLayout to address ~237243
(07:50:52 AM) KOS-MOS: Bug 237243 - https://bugs.eclipse.org/bugs/show_bug.cgi?id=237243 - Platform / SWT / 3.4 - All / All - NEW / major / - Assignee: veronika_irvine@yahoo.com - GridData layout sometimes does not have equal columns when it should
(07:51:09 AM) krbarnes: francis4: right... the widthHint might not be honoured by the layout. At very least, specifying FILL_HORIZONTAL and a width hint seems odd.
(07:51:20 AM) rcjsuen: krbarnes: yes, I find that odd also
(07:52:59 AM) jmcconnell [n=jmcconne@97-119-78-98.omah.qwest.net] entered the room.
(07:53:01 AM) Francis Upton: krbarnes: but absent the widthHint the layout manager should ask the component for its size, so I'm not sure that means anything
(07:54:11 AM) Francis Upton: and the widthHint should be just the computeSize I would think (assuming it's correctly longer than the proposed value)
(07:56:00 AM) krbarnes: I don't know about widthHint vs FILL_HORIZONTAL. I think the FILL bit wins and the hint should be ignored.
(07:57:06 AM) krbarnes: I bet if you just make a button, put that text on it, parented by a shell with no layout manager, and call pack() on the button, it will get the right size.
(07:57:46 AM) Francis Upton: krbarnes: i bet you are right
(07:58:20 AM) KevinMcGuire [n=kevinm@nat/ibm/x-2ee2d3e6dc7afd16] entered the room.
(07:58:46 AM) krbarnes: if that is true, I suspect that this is not an SWT bug.
(07:59:40 AM) Francis Upton: krbarnes: it's probably not a problem with the button, i agree
(08:02:23 AM) krbarnes: right, the width of the parent composite could be too narrow.
(08:02:36 AM) rcjsuen: Unsurprisingly,  iam having difficulties reproducing the problem.
(08:04:18 AM) krbarnes: Iit's probably been fixed already.
(08:05:01 AM) rcjsuen: i'm also on linux
(08:05:06 AM) rcjsuen: that might be another problem
(08:05:07 AM) Francis Upton: krbarnes: rcjsuen it should never go below the minwidth, but i don't think that's set
(08:06:05 AM) borisb6i1 [n=bbokowsk@nat/ibm/x-e6df533b60067600] entered the room.
(08:06:39 AM) Francis Upton: i think the issue is they should do a computeSize() and set data.minimumWidth to the preferred size of the button, and GridLayout should respect that
(08:07:21 AM) Francis Upton: GridLayout will go below the widthHint if it needs the space (and it probably does given this is in a constrained parent composite
(08:07:59 AM) Francis Upton: I'm going to give this to the debug folks (who own this code), and I will copy this transcript into the bug report
Comment 4 Eclipse Webmaster CLA 2019-09-06 16:11:30 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.