| Summary: | [debug] label "Enable OT/Equinox" is truncated when dialog font is increased | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] Objectteams | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||
| Component: | OTDT | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | minor | ||||||
| Priority: | P3 | ||||||
| Version: | 0.8 | ||||||
| Target Milestone: | 2.0 RC2 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Stephan Herrmann
Created attachment 196379 [details]
fix
Confusion was caused by the fact that we are adapting base classes
from debug.ui and pde.ui,
class LaunchConfigurationTabGroupViewer has a two phase init:
The constructor via createControl initializes the CTabFolder and already
applies the configured dialog font. Only in phase two the individual pages
are created into the fully configured parent.
In debug.ui-land it seems all intermediate children of the CTabFolder
consistently pass the parent font down the line.
In pde.ui-land class MainTab creates an intermediate Composite of which
it fails to set the font before creating individual blocks into it.
This is where our checkbox was added, so that at creation type it had
wrong font size causing a wrong widthHint to be computed.
To add insult to injury, both camps have slighlty different copies of a class
called SWTFactory. The very first difference is:
public static int getButtonWidthHint(Button button) {
- /*button.setFont(JFaceResources.getDialogFont());*/
+ button.setFont(JFaceResources.getDialogFont());
PixelConverter converter= new PixelConverter(button);
int widthHint= converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
}
pde.ui uses the first line to compensate the missing font propagation,
whereas debug.ui doesn't need it. Weird, I'd say.
Long story short: the patch fixes this inconsistency by searching for the
CTabFolder ancestor and applying its font to our "Object Teams Runtime"
group before creating the checkbox.
Patch was committed as r1623. Verified using build 201105311237 |