Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 219451 Details for
Bug 386417
A tab label in Tabbed Properties View is cut-off towards right-side
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed fix
DefectFix.patch (text/plain), 2.99 KB, created by
Amit Joglekar
on 2012-08-01 15:03:06 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Amit Joglekar
Created:
2012-08-01 15:03:06 EDT
Size:
2.99 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.views.properties.tabbed >diff --git src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java >index 468f1d5..a23c0de 100755 >--- src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java >+++ src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java >@@ -242,6 +242,9 @@ > bounds.height + 1); > } > >+ /* >+ * Add INDENT pixels to the left as a margin. >+ */ > int textIndent = INDENT; > FontMetrics fm = e.gc.getFontMetrics(); > int height = fm.getHeight(); >@@ -256,7 +259,7 @@ > textIndent = textIndent - 3; > } > e.gc.drawImage(tab.getImage(), textIndent, textMiddle - 1); >- textIndent = textIndent + 16 + 5; >+ textIndent = textIndent + 16 + 4; > } else if (tab.isIndented()) { > textIndent = textIndent + INDENT; > } >@@ -610,13 +613,8 @@ > elements[i].setLayoutData(null); > > if (i != widestLabelIndex) { >- String label = ((ITabItem) children[i]).getText(); >- int width = getTextDimension(label).x; >- if (((ITabItem) children[i]).isIndented()) { >- width = width + INDENT; >- } >- if (width > getTextDimension(((ITabItem) children[widestLabelIndex]) >- .getText()).x) { >+ int width = getTabWidth((ITabItem) children[i]); >+ if (width > getTabWidth((ITabItem) children[widestLabelIndex])) { > widestLabelIndex = i; > } > } >@@ -624,6 +622,22 @@ > } > > computeTopAndBottomTab(); >+ } >+ >+ private int getTabWidth(ITabItem tabItem) { >+ int width = getTextDimension(tabItem.getText()).x; >+ /* >+ * To anticipate for the icon placement we should always keep the >+ * space available after the label. So when the active tab includes >+ * an icon the width of the tab doesn't change. >+ */ >+ if (tabItem.getImage() != null) { >+ width = width + 16 + 4; >+ } >+ if (tabItem.isIndented()) { >+ width = width + INDENT; >+ } >+ return width; > } > > /** >@@ -684,21 +698,12 @@ > String properties_not_available = TabbedPropertyMessages.TabbedPropertyList_properties_not_available; > result.x = getTextDimension(properties_not_available).x + INDENT; > } else { >- ITabItem widestTab = elements[widestLabelIndex].getTabItem(); >- int width = getTextDimension(widestTab.getText()).x + INDENT; > /* >- * To anticipate for the icon placement we should always keep the >- * space available after the label. So when the active tab includes >- * an icon the width of the tab doesn't change. >+ * Add INDENT pixels to the left of the longest tab as a margin. > */ >- if (widestTab.getImage() != null) { >- width = width + 16 + 4; >- } >- if (widestTab.isIndented()) { >- width = width + 10; >- } >+ int width = getTabWidth(elements[widestLabelIndex].getTabItem()) + INDENT; > /* >- * Add 10 pixels to the right of the longest string as a margin. >+ * Add 10 pixels to the right of the longest tab as a margin. > */ > result.x = width + 10; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 386417
:
219450
| 219451 |
219452
|
219453