Mercurial Hosting > junotu
changeset 21:0e480624a38a
TabEdit layout: introducted minimum height for content
author | Fox |
---|---|
date | Wed, 04 May 2022 23:47:55 +0200 |
parents | 981d634a05ac |
children | a60e20304924 |
files | src/junotu/GUIToolbox.java |
diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/junotu/GUIToolbox.java Wed May 04 18:55:18 2022 +0200 +++ b/src/junotu/GUIToolbox.java Wed May 04 23:47:55 2022 +0200 @@ -90,7 +90,7 @@ content.setMaximumSize( new Dimension( preferred.width, Integer.MAX_VALUE ) ); tags.setMaximumSize( new Dimension( preferred.width, Integer.MAX_VALUE ) ); - preferred.height = 32+4+content.getPreferredSize().height+tags.getPreferredSize().height+512; + preferred.height = 32+4+Math.max(content.getPreferredSize().height, 32*12)+tags.getPreferredSize().height+512; return preferred; } @@ -112,13 +112,17 @@ content.setMaximumSize( new Dimension( width, Integer.MAX_VALUE ) ); tags.setMaximumSize( new Dimension( width, Integer.MAX_VALUE ) ); + int contentHeight = Math.max(content.getPreferredSize().height, 32*12); + int tagsHeight = (tags.getPreferredSize()).height+512; + int y = 0; title.setBounds( 0, y, width, 32 ); y += 32; y += 4; - content.setBounds( 0, y, width, (content.getPreferredSize()).height ); - y += (content.getPreferredSize()).height; - tags.setBounds( 0, y, width, (tags.getPreferredSize()).height+512 ); + content.setBounds( 0, y, width, contentHeight ); + y += contentHeight; + tags.setBounds( 0, y, width, tagsHeight ); + y += tagsHeight; } }