Cleanup sidebar expanding/closing

- Instead of changing the frame width, just revalidate the width to match
minumum size in case the size is smaller than it
- On restoration from maximize, revalidate frame size to not end up in
having small window with opened sidebar

Closes #1795 and closes #1300

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-04-24 20:01:01 +02:00
parent c33c6ef9d7
commit 4d38363e57
2 changed files with 65 additions and 47 deletions

View File

@@ -228,17 +228,6 @@ public class SwingUtil
});
}
/**
* Revalidate minimum frame size.
*
* @param frame the frame
*/
public static void revalidateMinimumSize(final JFrame frame)
{
// The JFrame only respects minimumSize if it was set by setMinimumSize, for some reason. (atleast on windows/native)
frame.setMinimumSize(frame.getLayout().minimumLayoutSize(frame));
}
private static BufferedImage resizeImage(BufferedImage image, int newWidth, int newHeight)
{
final Image tmp = image.getScaledInstance(newWidth, newHeight, Image.SCALE_SMOOTH);