From: minkee.lee Date: Fri, 30 Oct 2015 06:19:17 +0000 (+0900) Subject: error-icon: use drawImage() for icon. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18388384bf18aa47d4abde558c79ef05fb46493a;p=sdk%2Femulator%2Femulator-manager.git error-icon: use drawImage() for icon. In windows, setBackgroundImage() looks that it fills all canvas with image. So I changed it with drawImage(). Change-Id: I4a53caad1957a23b7f95c4a9824fd164fd05b586 Signed-off-by: minkee.lee --- diff --git a/src/org/tizen/emulator/manager/ui/renewal/dialog/DeviceTemplateModifyDialog.java b/src/org/tizen/emulator/manager/ui/renewal/dialog/DeviceTemplateModifyDialog.java index f96ea69..b67f978 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/dialog/DeviceTemplateModifyDialog.java +++ b/src/org/tizen/emulator/manager/ui/renewal/dialog/DeviceTemplateModifyDialog.java @@ -46,7 +46,8 @@ import org.tizen.emulator.manager.vms.VMProperty; public class DeviceTemplateModifyDialog extends ModifyDialog { public final static int WIDTH = 484; - private final static int HEIGHT = 496; +// private final static int HEIGHT = 496; + private final static int HEIGHT = 497; public DeviceTemplateModifyDialog(Shell parent, String title) { super(parent, title, WIDTH, HEIGHT); diff --git a/src/org/tizen/emulator/manager/ui/renewal/dialog/VMModifyDialog.java b/src/org/tizen/emulator/manager/ui/renewal/dialog/VMModifyDialog.java index cab9587..0ba7ede 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/dialog/VMModifyDialog.java +++ b/src/org/tizen/emulator/manager/ui/renewal/dialog/VMModifyDialog.java @@ -44,7 +44,8 @@ public class VMModifyDialog extends ModifyDialog { private final static String TITLE = "VM Modify"; public final static int WIDTH = 484; // private final static int WIDTH = 500; - private final static int HEIGHT = 496; +// private final static int HEIGHT = 496; + private final static int HEIGHT = 497; public VMModifyDialog(Shell parent) { super(parent, TITLE, WIDTH, HEIGHT); diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ModifyDialogItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ModifyDialogItem.java index fcb511e..7f3535e 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ModifyDialogItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ModifyDialogItem.java @@ -32,6 +32,9 @@ package org.tizen.emulator.manager.ui.renewal.item.modify.common; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.graphics.GC; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.GridData; @@ -188,7 +191,7 @@ public abstract class ModifyDialogItem implements IModifyDialogItem { // show error icon if (stateIconCanvas == null || stateIconCanvas.isDisposed()) { stateIconCanvas = new Canvas(item.getBody(), SWT.NONE); - stateIconCanvas.setBackgroundImage(ImageResources.ICON_STATE_ERROR.getImage()); + addStateIconCanvasListener(); } int width = ERROR_ICON_SIZE, height = ERROR_ICON_SIZE; FormData data = new FormData(width, height); @@ -207,8 +210,21 @@ public abstract class ModifyDialogItem implements IModifyDialogItem { FormData data = new FormData(0, 0); stateIconCanvas.setLayoutData(data); } + stateIconCanvas.redraw(); item.getBody().layout(true,true); } + + private void addStateIconCanvasListener() { + stateIconCanvas.addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + GC gc = e.gc; + gc.drawImage(ImageResources.ICON_STATE_ERROR.getImage(), 0, 0); + } + }); + } + } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/SensorItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/SensorItem.java index 1053413..c10440d 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/SensorItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/SensorItem.java @@ -56,8 +56,6 @@ public class SensorItem extends CheckBoxItem { dataList.add(new CheckItemData("press", "Pressure")); dataList.add(new CheckItemData("uv", "Ultraviolet")); dataList.add(new CheckItemData("hrm", "Heartbeat Rate")); - dataList.add(new CheckItemData("test-mob", "test mobile")); - }