From 0ed6302e1a4755739182018dc54c4c61e6a9e8e4 Mon Sep 17 00:00:00 2001 From: jooyoul_lee Date: Wed, 14 May 2014 22:26:50 +0900 Subject: [PATCH] NSCREEN : nscreen features left align nscreen feature names and group names -> left align Change-Id: I449e147d4f267bc3f2588c8a0493169b324664d3 Signed-off-by: jooyoul_lee --- .../ui/views/nscreen/NScreenGroup.java | 5 ++- .../webuibuilder/ui/views/nscreen/NScreenPage.java | 2 +- .../ui/views/nscreen/NScreenSimpleRenderer.java | 50 +++++++++++----------- 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenGroup.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenGroup.java index d14471a..04eaa38 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenGroup.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenGroup.java @@ -40,6 +40,8 @@ public class NScreenGroup extends Composite { public static final int MIN_GROUP_ITEM_HEIGHT = 38; public static final int ITEM_TOP_MARGIN = 0; public static final int ITEM_W_MARGIN = 5; + + public static final int IMAGE_MARGIN = 50; private int height = MIN_GROUP_ITEM_HEIGHT; private NScreenType groupType; @@ -93,7 +95,8 @@ public class NScreenGroup extends Composite { e.gc.setFont(FontUtil.NSCREEN_GROUP); Point textWH = FontUtil.getTextArea(buffer.toString(), e.gc); - int x = rect.x + (rect.width - textWH.x) / 2; +// int x = rect.x + (rect.width - textWH.x) / 2; + int x = rect.x + IMAGE_MARGIN; int y = rect.y + (GROUP_LABEL_HEIGHT - textWH.y) / 2; if (hasSelection()) { diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenPage.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenPage.java index 0e816f4..b841b71 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenPage.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenPage.java @@ -51,7 +51,7 @@ import org.tizen.webuibuilder.ui.views.nscreen.model.NScreenPageModel; */ public class NScreenPage extends Page { // private final int NSCREEN_TITLE_HEIGHT = 40; - private final int NSCREEN_MIN_WIDTH = 295; + private final int NSCREEN_MIN_WIDTH = 230; private final NScreenPageModel mNScreenPageModel; private NScreenBaseComposite mParentComposite; diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenSimpleRenderer.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenSimpleRenderer.java index 00d1934..83a98cc 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenSimpleRenderer.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenSimpleRenderer.java @@ -20,6 +20,7 @@ import org.tizen.webuibuilder.model.nscreen.NScreenModel.NScreenType; public class NScreenSimpleRenderer implements INScreenDrawRenderer { private static int X_MARGIN = 10; + private static int IMAGE_MARGIN = 50; @Override public void draw(GC gc, Canvas canvas, int state, boolean isSelected, boolean isEnabled, @@ -216,34 +217,35 @@ public class NScreenSimpleRenderer implements INScreenDrawRenderer { // int targetY = (canvas.getClientArea().height - IMAGE_SIZE) / 2; Rectangle rect = canvas.getClientArea(); NScreenType type = model.getType(); - if (type == NScreenType.COMMON || type == NScreenType.ORIENTATION - || type == NScreenType.PIXELRATIO) { +// if (type == NScreenType.COMMON || type == NScreenType.ORIENTATION +// || type == NScreenType.PIXELRATIO) { gc.setFont(getGroupFont(model)); String content = model.getName(); Point textWH = FontUtil.getTextArea(content, gc); - int x = rect.x + (rect.width - textWH.x) / 2; +// int x = rect.x + (rect.width - textWH.x) / 2; + int x = rect.x + IMAGE_MARGIN; int y = rect.y + (rect.height - textWH.y) / 2; gc.drawText(content, x, y, true); - } else if (type == NScreenType.RESOLUTION) { - gc.setFont(getGroupFont(model)); - String content1 = model.getName(); - // String content2 = - // NScreenUtil.getResolutionText(model.getDeviceWidth(), model.getDeviceHeight(), - // false) - // + " " - // + NScreenUtil.getRatioText(model.getDeviceWidth(), - // model.getDeviceHeight(), true); - Point content1WH = FontUtil.getTextArea(content1, gc); - // Point content2WH = FontUtil.getTextArea(content2, gc); - int x1 = rect.x + (rect.width - content1WH.x) / 2; - // int x2 = rect.x + (rect.width - content2WH.x) / 2; - // int y1 = rect.y + (rect.height - content1WH.y - content2WH.y) / 2; - int y1 = rect.y + (rect.height - content1WH.y) / 2; - // int y2 = y1 + content1WH.y; - gc.drawText(content1, x1, y1, true); - // gc.drawText(content2, x2, y2, true); - } else { - - } +// } else if (type == NScreenType.RESOLUTION) { +// gc.setFont(getGroupFont(model)); +// String content1 = model.getName(); +// // String content2 = +// // NScreenUtil.getResolutionText(model.getDeviceWidth(), model.getDeviceHeight(), +// // false) +// // + " " +// // + NScreenUtil.getRatioText(model.getDeviceWidth(), +// // model.getDeviceHeight(), true); +// Point content1WH = FontUtil.getTextArea(content1, gc); +// // Point content2WH = FontUtil.getTextArea(content2, gc); +// int x1 = rect.x + (rect.width - content1WH.x) / 2; +// // int x2 = rect.x + (rect.width - content2WH.x) / 2; +// // int y1 = rect.y + (rect.height - content1WH.y - content2WH.y) / 2; +// int y1 = rect.y + (rect.height - content1WH.y) / 2; +// // int y2 = y1 + content1WH.y; +// gc.drawText(content1, x1, y1, true); +// // gc.drawText(content2, x2, y2, true); +// } else { +// +// } } } -- 2.7.4