From: jihye424.kim Date: Wed, 18 Nov 2015 11:52:41 +0000 (+0900) Subject: table item: set font when compute text width X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e3791b9b743c24188450b826421033089fd2bb7;p=sdk%2Femulator%2Femulator-manager.git table item: set font when compute text width Change-Id: Ie30bc7d5d9359c7949007ba4ea2dff828680ddbf Signed-off-by: jihye424.kim --- diff --git a/src/org/tizen/emulator/manager/ui/table/TableItemCell.java b/src/org/tizen/emulator/manager/ui/table/TableItemCell.java index 3d9ed13..de40515 100644 --- a/src/org/tizen/emulator/manager/ui/table/TableItemCell.java +++ b/src/org/tizen/emulator/manager/ui/table/TableItemCell.java @@ -131,24 +131,24 @@ class TableItemCell extends Composite { String drawingText = data.drawingText; if (data.needRedrawingText) { drawingText = item.getText(index); - int textWidth = TextSizeUtil.stringExtend(getFont(), drawingText).x; + int textWidth = TextSizeUtil.stringExtend(FontResources.ITEM_FONT, drawingText).x; if (textWidth > (rect.width - itemSize.x - 10)) { while((textWidth > (rect.width - 10) - TextSizeUtil.OMITLEN) && drawingText.length() > 1) { drawingText = drawingText.substring(0, drawingText.length() - 1); - textWidth = TextSizeUtil.stringExtend(getFont(), drawingText).x; + textWidth = TextSizeUtil.stringExtend(FontResources.ITEM_FONT, drawingText).x; } drawingText = drawingText + TextSizeUtil.OMIT; } data.needRedrawingText = false; data.drawingText = drawingText; - data.drawingTextWidth = TextSizeUtil.stringExtend(getFont(), drawingText).x; + data.drawingTextWidth = TextSizeUtil.stringExtend(FontResources.ITEM_FONT, drawingText).x; } int spacing = hasItem ? 5 : 0; switch(item.getParentTable().getColumn(index).getAlignment()) { case SWT.LEFT: - itemX += (hasItem ? 5 : 0); + itemX += 5; textX += itemX + itemSize.x + spacing; break; case SWT.RIGHT: