From 2af1f76830191e4cbf2267bca001b31284d82fd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Mon, 8 Jul 2013 07:42:08 +0200 Subject: [PATCH] Fixed saving splitpane(traitslist/tree) position --- .../src/com/jpexs/decompiler/flash/gui/MainFrame.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java index 86b44ac0f..32228b6fd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java @@ -903,7 +903,9 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection splitPane2.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent pce) { - Configuration.setConfig("gui.splitPane2.dividerLocation", pce.getNewValue()); + if (detailPanel.isVisible()) { + Configuration.setConfig("gui.splitPane2.dividerLocation", pce.getNewValue()); + } } }); View.centerScreen(this); @@ -966,7 +968,11 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection } splitPane1.setDividerLocation((Integer) Configuration.getConfig("gui.splitPane1.dividerLocation", getWidth() / 3)); - splitPane2.setDividerLocation((Integer) Configuration.getConfig("gui.splitPane2.dividerLocation", splitPane2.getHeight() * 3 / 5)); + int confDivLoc = (Integer) Configuration.getConfig("gui.splitPane2.dividerLocation", splitPane2.getHeight() * 3 / 5); + if (confDivLoc > splitPane2.getHeight() - 10) { //In older releases, divider location was saved when detailPanel was invisible too + confDivLoc = splitPane2.getHeight() * 3 / 5; + } + splitPane2.setDividerLocation(confDivLoc); splitPos = splitPane2.getDividerLocation(); }