Community
Participate
Working Groups
20021115 The dialog font is not honoured by the search preference page or main dialog. Preference pages have the dialog font set as the font of the control sent to createContents - you can just copy the font from the parent to the children you create. Other dialogs can get it by calling JFaceResources.getDialogFont().
Do I have to apply the font to all the widgets i.e. text, combos, radios... or only to the page and the dialog?
To all of widgets. The easiest way to do this is is use setFont(parent.getFont ()) - we already propogate this font as far as we can for you. BTW the search page is already halfway there as all of the JFace components give you this for free - only the radios and the combo boxes need this. The easiest way to test is to set the dialog font in the fonts preference page (will be in tomorrows integration build)and see what doesn't change.
I changed the font and looked at the search preference page: can you please explain why some of the field editor fonts (e.g. checkbox) are set and some are not? What would be the code to set the font on a field editor - there is no setFont API and boolEditor.getLabelControl(parent) ends in having two widgets/editors.
Please let me know which are not set. If we do not set them this is our bug.
Created attachment 2569 [details] fixes dialogs fixes the following: SearchDialog ExtendedDialogWindow TextSearchPage ScopePart TypeFilteringDialog ListDialog @@@@ Preference page cannot be changed because there is no way to change the font of a FieldEditor :( applyFont() - is called on all FieldEditors but there's no way to set the font @@@@ Todo: SearchPreferencePage#createFieldEditors() -- set the font for the FieldEditors
Created attachment 2573 [details] fixes ReplaceDialog forgot that one ;)
A solution which needs all other pages (of which I know nothing) to catch-up is not acceptable. Imagine this feature when using WSAD and/or other contributed plug-ins: do you think they will fix all their dialogs? If you look at the current Eclipse SDK UI with a large dialog font set you'll see how bad it looks if plug-in developers don't act on the feature: wizards, dialog and preference pages show up with mixed fonts. Moving back to JFace/SWT for more support for setting the dialog font automatically. Just out of curiosity: why does a widget not inherit its parent font? What are the technical and design issues behind the current implementation?
The setting using the parent font is because we try and propogate the font as much as we can for you - JFace will give you the font as the font of the parent to prevent you having to do the extra work. If there is JFace support missing on any JFace component we will add it but we cannot do the same for SWT components - SWT only gets what the OS will give them and that is only one font. This font was added in 1.0 to satisy user requirements to have more than one font to choose from for thier dialogs. We have only exposed it now in the UI as there were higher priority items in previous releases. Please append any missing JFace functionality to PR 19346 and we will provide what we can.
please take a look at bug 27386
Font propogation has now been added to all field editors ars required. Moving back to search.
Created attachment 2588 [details] fixes dialogs and pref page pref page now updated also
Tod, if you open the Search preference page you'll see that the combobox font of the ComboFieldEditor is still not updated. Also, the dialog opened by the ColorFieldEditor doesn't use the dialog fonts (click on the colored button). NOTE: The bug is currently in search-inbox. Feel free to move it to yours or create a new PR for above issues. As you can see it's quite a bit of work and testing involved to correctly set the dialog font in all our dialogs and wizards. If we could follow Dirk's suggestion (bug 26990) this would also be appreciated by other plug-in contributors like WSAD. For the Search dialog: waiting until a decision is taken in bug 26990.
Danny I am going to answer this in the main PR so that everyone gets the message...
public static applyDialogFont(Control control) has been added to Dialog. This can be called to apply the dialog font to the tree of a control whose font is the default font. I could not hook this up by default because it causes some layout problems on many of the pages and dialogs we have if it is called after widget creation as sizing is frequently done in the creation code. We do not wish to generate any layout problems by the addition of this API. I have also changed initializeBounds to use the dialog font for the calculations and not the font of the passed control. In the dialog provided by the workbench this will not do anything but for those dialogs provided by other components this will allow them to do the sizing before applying the dialog font.
The ComboFieldEditor is supplied by the search component - I can't do anything about it. Here is the method you need to change in org.eclipse.search.internal.ui.util.ComboFieldEditor public Combo getComboBoxControl(Composite parent) { if (fCombo == null) { fCombo= new Combo(parent, SWT.READ_ONLY); for (int i= 0; i < fEntryNamesAndValues.length; i++) { fCombo.add(fEntryNamesAndValues[i][0], i); } fCombo.setFont(parent.getFont());<*******************> fCombo.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent evt) { String oldValue= fValue; String name= fCombo.getText(); fValue= getValueForName(name); setPresentsDefaultValue(false); fireValueChanged(VALUE, oldValue, fValue); } }); } return fCombo; }
Sure. Just forgot that bug 24928 isn't fixed yet ;-) Fixed ComboFieldEditor. The comment for ColorFieldDialog is valid - isn't it?
The ColorDialog is supplied by the platform. That is a setting that needs to be set in the OS.
Removing M5 again. Will be decided soon if (and how) we do it.
This has been fixed for RC3 by Dirk