Community
Participate
Working Groups
Reporter: Karen Language: Tranditional Chinese, Simplied Chinese Build driver: eclipse-SDK-I20030129-gtk Severity: Normal OS: RedHat8.0 with GTK+2.2 JDK Ver.: IBM JDK1.3.1 + SR3 Test case #: Summary: DBCS: Buttons truncated in Project Properties "Java Build Path" panel Description: Steps to recreate problem: 1-Launch Eclipse on RedHat8.0 using GTK2.2 library 2-Right click on Project name, select "Properties" and keep the default window size 3-Select "Java Build Path" 3-Check "Source", "Projects", "Libraries" and "Order and Export" views <<Error>> The buttons in these views are truncated. Please refer to sch_gtk22.jpg and tch_gtk22.jpg. <<Expected Result>> The whole buttons should be displayed successfully. <<Note>> On English and Korean RedHat8.0 with GTK+2.2 platforms, there's no this bug. There is no this bug on RedHat8.0 with GTK2.0.6, either.
Created attachment 3315 [details] Buttons truncated on SCH RedHat8.0 with GTK+2.2
Created attachment 3316 [details] Buttons truncated on TCH RedHat8.0 with GTK+2.2
What is your system font? You can check by seeing what your default dialog font is.
This is a JDT issue. They should be using the button sizing API provided in DialogPage.setButtonLayoutData(Button button) or Dialog.setButtonLayoutData (Button button). Be aware that this calculation also uses the dialog font so be sure that the dialog font is also in use by the buttons.
Tod, why do you think that this has anything to do with using DialogPage.setButtonLayoutData(Button button). This method simply sets a grid data object. The method sets the width to data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); Can you please comment on this and move it back to JDT/UI.
This calculation is used to give a reasonable GridData to buttons thoroughtout Eclipse - otherwise yoiu have to rely on the default spacing. The problem here is likely two fold however 1) Buttons are cut off because the list beside them is set to be too large and they are truncated 2) The buttons are generally too small and should be sized consistent with the rest of Eclipse
A question to the reporters. Does the width of the dialog cover the whole width of the screen in this case ?
And another question. Which font did you use to produce the problem
Yes, the width of the dialog(the default size) cover the whole width of the screen and the default dialog font is the System Font: Sans-regular-10 on both SCH and TCH platforms.
As Tod pointed out the buttons are truncated due to the fact that the list is sized to big. There are two SWT PRs which discuss the problems regarding sizing under different platforms (bug 30804 and bug 31278). Strange is the fact that I can't reproduce the bug using build 200302061700 with GTK 2.2. Using font Sans-regular-10 produces much smaller buttons on my machine. Removed DBCS from title since this bug has nothing to do with DBCS
But, we verified this bug again with M5 and I20030211 build, there're still truncated buttons in Java Build Path dialog on SCH and TCH RedHat8.0 GTK+2.2 platforms. NOTE: There's no this bug on English RedHat8.0 GTK+2.2 platform.
Bug is also related to bug 26900.
The strange thing is that the width of all buttons on this dialog (even OK, CANCEL, ...) is big. Asking SWT for an explanation how this can happen. I am not able to produce such big buttons under Linux-GTK using a Sans-regular-10 font. Could it be that a SCH and TCH installation doesn't have such a font and are using some font mapping which produces such big buttons.
Please move back to JDT/UI if an action is required on our side.
I've seen this on Japanese locale as well. This is very important bug to support GTK 2.2.
FH to investigate and consult with SSQ. This is a P2. Don't fix this for 2.1 unless the fix is trivial.
Sorry, I typed the comment into the wrong bug. We still need to investigate but the problem is a DBCS thing because it happens only on a J platform. Could it be the dreaded "average character width" is huge on a J platform, causing everything to be big?
It's not Japanese unique, we've seen on all of DBCS locales. I've just tried on gtk2.2.1 with ja_JP.eucjp locale, but I got same result. It did not occurre on gtk2.0.6. In gtk2.2.x, Confirm Exit dialog and save workspace progress indicator dialog which pop up at exiting eclipse, the width is rendered as long as the screen horizontal size, even if no DBCS text in the dialog at all.
If you resize the dialog does the buttons layout out correctly ? I have test this and I can get the situation on Gtk en_US, Motif, and Windows. It's just a matter of resizing the dialog to a bad size. Maybe the situation here is that the dialog is open with a wrong size what's bug! I do believe this is UI bug though. Please, play resizing the dialog on GTK and Windows and let me know what you think. For me the problem is that the initial size of the Dialog is bad on GTK.
>>>If you resize the dialog does the buttons layout out correctly ? As for the confirm exit dialog, the buttons layout is not changed on gtk and motif. On Windows the dialog is not re-sizable. It seems that all of decorations are always shown on gtk, I think this is another issue. It's odd for me why gtk2.2.x displays enlarged windows size on DCBS country locales. I played gtk-demo of gtk2.2, it did not have such a problem.
>It seems that all of decorations are always shown on gtk This is a result of the window manager interpreting our hints incorrectly and there is nothing we can do to change it. As a result, all shells with a title bar are resizable.
Felipe, Please talk to Tod about the way that button widths are determined in the UI code. Code is in DialogPage: /** * Button width in dialog units (value 61). */ public int BUTTON_WIDTH = 61; protected GridData setButtonLayoutData(Button button) { GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); data.heightHint = convertVerticalDLUsToPixels (IDialogConstants.BUTTON_HEIGHT); int widthHint = convertHorizontalDLUsToPixels (IDialogConstants.BUTTON_WIDTH); data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); button.setLayoutData(data); return data; } Dialog: public static int convertHorizontalDLUsToPixels( FontMetrics fontMetrics, int dlus) { // round to the nearest pixel return ( fontMetrics.getAverageCharWidth() * dlus + HORIZONTAL_DIALOG_UNIT_PER_CHAR / 2) / HORIZONTAL_DIALOG_UNIT_PER_CHAR; }
I've tried to run RC3a on RedHat 9 golden with sun jvm 1.4.1_02, and confirmed it did not have this error.
Fuse-san, since this problem doesn't happen in RedHat 9.0 can I close this bug ?
Felipe, please go ahead.
fixed in redhat 9.0 (no swt code was released to fix this problem)