提交 0dde5c34 编写于 作者: S serge-rider

Grid column repackage fix

上级 c45465e7
...@@ -84,6 +84,9 @@ public abstract class LightGrid extends Canvas { ...@@ -84,6 +84,9 @@ public abstract class LightGrid extends Canvas {
*/ */
private static final int SELECTION_DRAG_BORDER_THRESHOLD = 2; private static final int SELECTION_DRAG_BORDER_THRESHOLD = 2;
private static final boolean MAXIMIZE_SINGLE_COLUMN = false; private static final boolean MAXIMIZE_SINGLE_COLUMN = false;
// Indicates that last time refreshData was called grid control was hidden (had zero size)
// In that case columns will be repacked even if keepState is true
private boolean controlWasHidden;
public enum EventSource { public enum EventSource {
MOUSE, MOUSE,
...@@ -488,7 +491,7 @@ public abstract class LightGrid extends Canvas { ...@@ -488,7 +491,7 @@ public abstract class LightGrid extends Canvas {
int savedVSB = keepState ? vScroll.getSelection() : -1; int savedVSB = keepState ? vScroll.getSelection() : -1;
int[] oldWidths = null; int[] oldWidths = null;
if (keepState) { if (keepState && !controlWasHidden) {
// Save widths // Save widths
oldWidths = new int[columns.size()]; oldWidths = new int[columns.size()];
if (!columns.isEmpty()) { if (!columns.isEmpty()) {
...@@ -497,6 +500,7 @@ public abstract class LightGrid extends Canvas { ...@@ -497,6 +500,7 @@ public abstract class LightGrid extends Canvas {
} }
} }
} }
controlWasHidden = getClientArea().height == 0;
if (refreshColumns) { if (refreshColumns) {
this.removeAll(); this.removeAll();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册