From: jihye424.kim Date: Mon, 23 Nov 2015 02:25:04 +0000 (+0900) Subject: table: redraw table item view background X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45c28151bf1924384f96adc701dc6b8f1ef68035;p=sdk%2Femulator%2Femulator-manager.git table: redraw table item view background - redraw table item view background when changed table item height Change-Id: I3eeae3b1977adcc398a90d5cf932e2d71a606b96 Signed-off-by: jihye424.kim --- diff --git a/src/org/tizen/emulator/manager/ui/table/Table.java b/src/org/tizen/emulator/manager/ui/table/Table.java index 5a66190..1700f98 100644 --- a/src/org/tizen/emulator/manager/ui/table/Table.java +++ b/src/org/tizen/emulator/manager/ui/table/Table.java @@ -51,7 +51,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.TypedListener; -import org.tizen.emulator.manager.EmulatorManager; public class Table extends TableScrolledComposite { private static final int[] EMPTY_SELECTION = new int[0]; @@ -1103,10 +1102,8 @@ public class Table extends TableScrolledComposite { redraw(); } - if (EmulatorManager.isWin()) { - tableColumn.redraw(); - tableItem.redraw(); - } + tableColumn.redraw(); + tableItem.redraw(); this.layout(); } @@ -1279,9 +1276,19 @@ public class Table extends TableScrolledComposite { GC gc = e.gc; int top = 0; int height = getItemHeight(); - for (int i = 0; top < rect.height; i++, top += height) { + int itemCount = getItemCount(); + if (itemCount > 0) { + if (selection.length == 1) { + top = selectedItemHeight; + top += height * (itemCount-1); + } else { + top += height * itemCount; + } + } + + for (;top < rect.height; itemCount++, top += height) { Rectangle drawingRect = new Rectangle(0, top, rect.width, height); - if ((i%2) == 0) { + if ((itemCount%2) == 0) { gc.setBackground(ColorResources.ITEM_BG_COLOR_EVEN); } else { gc.setBackground(ColorResources.ITEM_BG_COLOR_ODD);