| Summary: | A tab label in Tabbed Properties View is cut-off towards right-side | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Amit Joglekar <joglekar> | ||||||||||
| Component: | UI | Assignee: | Paul Webster <pwebster> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | pwebster | ||||||||||
| Version: | 4.2 | ||||||||||||
| Target Milestone: | 4.3 M2 | ||||||||||||
| Hardware: | All | ||||||||||||
| OS: | All | ||||||||||||
| Whiteboard: | patch | ||||||||||||
| Bug Depends on: | |||||||||||||
| Bug Blocks: | 385795 | ||||||||||||
| Attachments: |
|
||||||||||||
Created attachment 219451 [details]
Proposed fix
Added a private method getTabWidth(ITabItem tabItem) for tab-width calculations. This method is now invoked from setElements() and computeSize() methods.
Made the logic in ListElement.paint() method consistent with rest of the code to use 4 units of space between image and text.
This patch can be further improved by using constants for image-width and image-to-text-space e.g.
protected static final int IMAGE_WIDTH = 16;
protected static final int IMAGE_TO_TEXT_SPACE = 4;
Created attachment 219452 [details]
Before fix
Created attachment 219453 [details]
After fix
For JUnit tests for this proposed fix, refer to attachments for Bug 385795. |
Created attachment 219450 [details] Project which can be used to reproduce this defect This defect reproduces in earlier versions like 3.6 as well. Cause is that the logic for setting widestLabelIndex value in setElements() method in TabbedPropertyList class is not consistent with rest of the code; the logic does not consistently take into account the indentation and image declared for a tab.