summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt
diff options
context:
space:
mode:
authorGrant Gayed <ggayed>2005-02-02 22:14:49 +0000
committerGrant Gayed <ggayed>2005-02-02 22:14:49 +0000
commitd9ff0920e38dbe40e7e183fc285b75f5b4dcdb26 (patch)
tree96cf01bf6aa3da77303f52e831cafb20998a3ace /bundles/org.eclipse.swt
parent158b8166e876537d373b81ddbd77938495950d45 (diff)
downloadeclipse.platform.swt-d9ff0920e38dbe40e7e183fc285b75f5b4dcdb26.tar.gz
eclipse.platform.swt-d9ff0920e38dbe40e7e183fc285b75f5b4dcdb26.tar.xz
eclipse.platform.swt-d9ff0920e38dbe40e7e183fc285b75f5b4dcdb26.zip
*** empty log message ***
Diffstat (limited to 'bundles/org.eclipse.swt')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TreeItem.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TreeItem.java
index a0b889a380..3006c7efe7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/TreeItem.java
@@ -744,8 +744,11 @@ public TreeItem getParentItem () {
* Returns the receiver's ideal width for the specified columnIndex.
*/
int getPreferredWidth (int columnIndex) {
- int textPaintWidth = textWidths [columnIndex] + 2 * MARGIN_TEXT;
- int result = getTextX (columnIndex) + textPaintWidth;
+ GC gc = new GC (parent);
+ gc.setFont (getFont (columnIndex));
+ int textPaintWidth = gc.textExtent (getText (columnIndex)).x + 2 * MARGIN_TEXT;
+ gc.dispose ();
+ int result = getTextX (columnIndex) + textPaintWidth + parent.getCellPadding (); /* right side cell pad */
result -= parent.columns [columnIndex].getX ();
return result;
}