From: minkee.lee Date: Tue, 29 Dec 2015 09:20:58 +0000 (+0900) Subject: label: fix label width and font size X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4112e9c4df4378c627e4827fd9bd63fd3466998;p=sdk%2Femulator%2Femulator-manager.git label: fix label width and font size - keep space for "*" mark. - Adjust font size. - Widen line label width. Change-Id: Ieefaf1ddd8f2629dfb6f32258c5a2a8fd7b6aec1 Signed-off-by: minkee.lee --- diff --git a/src/org/tizen/emulator/manager/ui/detail/item/DetailViewItem.java b/src/org/tizen/emulator/manager/ui/detail/item/DetailViewItem.java index 09e57e1..1636519 100644 --- a/src/org/tizen/emulator/manager/ui/detail/item/DetailViewItem.java +++ b/src/org/tizen/emulator/manager/ui/detail/item/DetailViewItem.java @@ -86,23 +86,26 @@ public abstract class DetailViewItem extends ViewItem { return upperItem; } + @Override public void initItem(Composite parent, IInfoViewItem upperItem) { initItem(parent, (DetailViewItem) upperItem); initStateLabel(); } + @Override public void initItem(Composite parent, IModifyViewItem upperItem) { initItem(parent, (DetailViewItem) upperItem); initStateLabel(); } + @Override public abstract void init(); protected ArrayList compList = new ArrayList(); protected static int ITEM_HEIGHT = 20; protected static int ITEM_WIDTH = 20; protected static int TITLE_HEIGHT = 20; - protected int TITLE_WIDTH = 102; // 100 -> 102 + protected int TITLE_WIDTH = 92; // 100 -> 102 -> 92 protected static int FILE_SELECT_BUTTON_WIDTH = 38; protected static int FILE_SELECT_BUTTON_HEIGHT = 20; @@ -234,7 +237,7 @@ public abstract class DetailViewItem extends ViewItem { @Override public void widgetDefaultSelected(SelectionEvent e) { // TODO Auto-generated method stub - + } }); @@ -248,6 +251,10 @@ public abstract class DetailViewItem extends ViewItem { GC gc = new GC(titleLabel); gc.setFont(titleLabel.getFont()); p = gc.textExtent(title); + if (p.x > TITLE_WIDTH) { + // font size -1 + titleLabel.setFont(FontResources.DETAIL_LABEL_FONT.getFont()); + } TITLE_WIDTH = p.x; gc.dispose(); @@ -532,6 +539,7 @@ public abstract class DetailViewItem extends ViewItem { stateLabel.redraw(); } + @Override public String getItemValue(VMPropertyValue value) { return value.getAdvancedOptionValue(name); } diff --git a/src/org/tizen/emulator/manager/ui/detail/item/LineLabelViewItem.java b/src/org/tizen/emulator/manager/ui/detail/item/LineLabelViewItem.java index 286db7f..8ed93b2 100644 --- a/src/org/tizen/emulator/manager/ui/detail/item/LineLabelViewItem.java +++ b/src/org/tizen/emulator/manager/ui/detail/item/LineLabelViewItem.java @@ -54,7 +54,7 @@ import org.tizen.emulator.manager.vms.xml.template.Item; public class LineLabelViewItem extends DetailViewItem{ - private Map itemMap = new HashMap(); + private final Map itemMap = new HashMap(); public LineLabelViewItem(Item template) { super(template); @@ -64,7 +64,7 @@ public class LineLabelViewItem extends DetailViewItem{ itemMap.put(name, item); } public AdvancedViewItem getItem(String name) { - return (AdvancedViewItem)itemMap.get(name); + return itemMap.get(name); } @Override @@ -81,9 +81,10 @@ public class LineLabelViewItem extends DetailViewItem{ @Override public void init() { count = 1; - TITLE_WIDTH = 150; + TITLE_WIDTH = 160; } + @Override protected void initTitle(boolean supportMinMode) { // if (supportMinMode && count > 1) { if (supportMinMode) {