From 1200cf2e87d82efeedd69e7782f7a66376421d6d Mon Sep 17 00:00:00 2001 From: tkellner Date: Fri, 21 Dec 2012 16:05:12 +0000 Subject: Only limit initial size in main GUI git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1158 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'BKUCommonGUI/src/main/java') diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java index 4074978b..a44ceb82 100644 --- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java +++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java @@ -2411,8 +2411,7 @@ public class BKUGUIImpl implements BKUGUIFacade { return resourceName; } - protected float getResizeFactor() { - + protected float getResizeFactor(int maxBaseWidth) { if (baseWidth == null || baseHeight == null || baseWidth == 0 || baseHeight == 0) { @@ -2420,7 +2419,7 @@ public class BKUGUIImpl implements BKUGUIFacade { int width = contentPanel.getWidth(); int height = contentPanel.getHeight(); float ratio = ((float) width / height); - baseWidth = width < 166 ? width : 166; + baseWidth = width < maxBaseWidth ? width : maxBaseWidth; baseHeight = (int) (baseWidth / ratio); if (baseHeight > height) { baseHeight = height; @@ -2434,12 +2433,25 @@ public class BKUGUIImpl implements BKUGUIFacade { return factor; } + protected float getResizeFactor() { + if (baseWidth == null || baseHeight == null || baseWidth == 0 + || baseHeight == 0) { + + // first call - determine base width and height + baseWidth = contentPanel.getWidth(); + baseHeight = contentPanel.getHeight(); + } + + float factor = (float) contentPanel.getSize().getWidth() / baseWidth; + return factor; + } + public void resize() { log.debug("Resizing ..."); updateHelpLabelIcon(); - float factor = getResizeFactor(); + float factor = getResizeFactor(166); this.sigDataFocusBorder.setBorderWidthFactor(factor); this.helpFocusBorder.setBorderWidthFactor(factor); -- cgit v1.2.3