table item: set font when compute text width
authorjihye424.kim <jihye424.kim@samsung.com>
Wed, 18 Nov 2015 11:52:41 +0000 (20:52 +0900)
committerjihye424.kim <jihye424.kim@samsung.com>
Wed, 18 Nov 2015 12:08:09 +0000 (21:08 +0900)
Change-Id: Ie30bc7d5d9359c7949007ba4ea2dff828680ddbf
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/ui/table/TableItemCell.java

index 3d9ed13..de40515 100644 (file)
@@ -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: