Community
Participate
Working Groups
Build ID: I20070323-1616 Steps To Reproduce: 1. Eclipse launch in Windows Vista (Japanese) 2. Window > preference > General > Appearance > Color and Fonts "MS UI Gotic" set as the Dialog font, and click OK button. 3. After, Window > preference > Run/Debug
Created attachment 64135 [details] ColorSelector.PNG Screen shot: Run/Debug setting page
In org.eclipse.jface /src/org/eclipse/jface/preference/ ColorSelector.java - The font of the parents composite is not succeeded in the constructor. - DEFAULT_FONT is used to calculate the image size in the computeImageSize method.
We should try and do something for 3.3.
Most of the time the font has not been set when the ColorSelector is created so we should base it off of the dialog font. Having said that I think the problem might be more subtle. What is your screen resolution? I have made the dialog font change but I am not convinced I have your case completly covered.
> What is your screen resolution? - Screen size : 1024 x 768 pixel - Dialog font : MS UI Gothic, Normal, Size 9 - System font : Meiryo, Normal, Size 9 I think that the correction is the following two points. 1) Inset " fButton.setFont(parent.getFont()); " after " fButton = new Button( ... " line 2) Use control font in computeImageSize gc.setFint(f) => gc.setFont(window.getFont())
It is likely to become the following fix to match the color change button of other editors (Ex: Perference > Java > Editor) to shape. - Not insert " fButton.setFont(parent.getFont()); " - Use DEFAULT_FONT in the computeImageSize method. - Not call convertHorizontalDLUsToPlixels in ColorFieldEditor.doFillIntoGrid method.
We can't slam the button font with the parent font because it is wrong on several platforms (such as the Mac) as they will have a default font per parent. Otherwise what I have released satisfies your suggestions (except that I use the dialog font). If you could check build >20070426 in 3.3 that would be a big help - I am going to mark this as FIXED
Created attachment 65362 [details] MS_UI_Gothic_9.png Use eclipse Build id: N20070428-0010 The height of the button are different to the Color Selector of Java > Editor.
The reason for this problem is that the font of the parents composite is not set to the button of ColorSelector in ColorFieldEditor.getChangeControl method. protected Button getChangeControl(Composite parent) { if (colorSelector == null) { colorSelector = new ColorSelector(parent); ==> colorSelector.getButton().setFont(parent.getFont()); colorSelector.addListener(new IPropertyChangeListener() {
Inaba-san have you tried this change? My concern is the following 1) We set the font based on the parent control 2) The code sets the font of the ColorSelector later to the dialog font 3) The text of the labels and the buttons are not in proportion. Either way I think it is too late in the cycle for me to take this any further without any more rigourous testing on other platforms and languages.
Created attachment 66246 [details] snapshot.png > Inaba-san have you tried this change? Yes (tried). New environment; - Windows Vista Ultimate - English - Eclipse 3.3 M7 (I20070503-1400) Steps To Reproduce: 1. Eclipse launch in Windows Vista (English) 2. Window > preference > General > Appearance > Color and Fonts "MS UI Gotic", "Regular", "9" set as the Dialog font, and click OK button. 3. After, Window > preference > Run/Debug
The problem of #8 is getChangeControl method of the ColorFieldEditor class, and the font of the parent composite is not set to the button.
After upgrade to Vista (Japaneses Edition), if you apply Meiryo as default font in System Preference, every dialog open in Eclipse looks ugly beacuse of too wide buttons. [Meiryo is a new font for VISTA and also a new set of fonts for Chinese/Korean edition. It looks very beautiful than UIGothic/Gothic.] I have made a workaround by overriding org.eclipse.swt.graphics.GC in a fragment. Here is my solution: changes in GC.java => public FontMetrics getFontMetrics() { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); checkGC(FONT); TEXTMETRIC lptm = OS.IsUnicode ? (TEXTMETRIC)new TEXTMETRICW() : new TEXTMETRICA(); OS.GetTextMetrics(handle, lptm); FontMetrics fm = FontMetrics.win32_new(lptm); // reported TEXTMETRICS#tmAveCharWidth is much larger for Meiryo // because it takes consideration both 8bit and 16bit characters. // But Eclipse is expecting only average width of 8bit characters. fm.handle.tmAveCharWidth = computeAverageAsciiCharWidth(); return fm; } private static String sample = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&()*+@`[]{}-:;?,. \'\"\\"; private int computeAverageAsciiCharWidth() { return stringExtent(sample).x / sample.length(); } The fragment works well for Eclipse 3.3(europe), but not for 3.4(gamymede) because org.eclipse.swt_3.4.** is now signed. I hope for a official fix for this problem. See attached jar file contained source of the fragment, also a PNG show the problem.
Created attachment 96371 [details] A workaround fragment(only works for 3.3)
Created attachment 96372 [details] Too wide buttons, before and after
Comment on attachment 96372 [details] Too wide buttons, before and after sorry, the annotation should be "it looks better"
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
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.