| Summary: | [Trim] Shell (TrimLayout + TrimArea) enforces a 4 pixel "margin" | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Peer Törngren <mbr-eclipse> | ||||||
| Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> | ||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | remy.suen | ||||||
| Version: | 4.1 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | stalebug | ||||||||
| Attachments: |
|
||||||||
Created attachment 182975 [details]
Screenshot showing the desired look
In this screenshot, the "footer" fills the entire bottom area.
Created attachment 182976 [details]
Screenshot showing the unwanted (default) look
In this screenshot, there is a 4 pixel white "margin" around the footer.
By running in debug mode, I was able to produce the same result by forcing TrimArea.computeWrappedTrim(int)) to return 0, which appears to be the proper solution if content is empty (as stated above).
Since it seems hard to get at the specific method in TrimArea, the way to produce the desired look (as seen in the screenshot above) is to override the method that creates the window content altogether. This works well as long as the windows is completely empty, but doesn't solve the core problem.
Workaround is to override org.eclipse.ui.application.WorkbenchWindowAdvisor.createWindowContents(Shell):
@Override
public void createWindowContents(Shell shell) {
shell.setLayout(new FillLayout());
getWindowConfigurer().createPageComposite(shell);
}
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. 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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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. -- The automated Eclipse Genie. |
Build Identifier: 20100617-1415 When opening a UI thru org.eclipse.ui.application.WorkbenchWindowAdvisor.createWindowContents(Shell), the call is delegated to org.eclipse.ui.internal.WorkbenchWindow.createDefaultContents(Shell), which uses a TrimLayout to arrange the contents. If content is empty (no toolbar, coolbar, or anything), the TrimArea will leave a 4 pixel "margin". The problem seems to be caused by org.eclipse.ui.internal.layout.TrimArea.computeWrappedTrim(int), which adds both tile and line spacing even if content is blank. For instance, the line before the last looks like this: // Finally, add enough room to provide spacing between the lines totalMinor += (lines.size() + 1) * LINE_SPACING; Even if lines are empty, it will return 1 * LINE_SPACING. A possible solution could be to do something like this (and similar for TILE_SPACING) if (!lines.isEmpty()) { totalMinor += (lines.size() + 1) * LINE_SPACING; } Reproducible: Always Steps to Reproduce: 1. create a UI with a standadalone view and no menu or toolbars 2. add a single component to the UI, use a FillLayout to make it fill the entire space 3. set the shell background color to black 4. launch the UI - you will see a black "margin" around the UI (hopefully this is clear enough, otherwise I can try to produce code snippet to illustrate)