Mercurial > hg > release > thermostat-1.4
changeset 1499:ec2da2dc1a60
Small fix to NotesView GUI. Notes Scrollpane and 'add' button interact better.
Reviewed-by: omajid
Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2014-August/010530.html
author | Jie Kang <jkang@redhat.com> |
---|---|
date | Wed, 20 Aug 2014 16:56:50 -0400 |
parents | f47c2a4d3d97 |
children | ff2313f0505a |
files | notes/client-swing/src/main/java/com/redhat/thermostat/notes/client/swing/internal/NotesView.java |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/notes/client-swing/src/main/java/com/redhat/thermostat/notes/client/swing/internal/NotesView.java Wed Aug 20 15:18:56 2014 -0400 +++ b/notes/client-swing/src/main/java/com/redhat/thermostat/notes/client/swing/internal/NotesView.java Wed Aug 20 16:56:50 2014 -0400 @@ -66,7 +66,6 @@ import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.Timer; -import javax.swing.border.EmptyBorder; import javax.swing.plaf.LayerUI; import com.redhat.thermostat.client.core.views.UIComponent; @@ -131,16 +130,21 @@ container.addToolBarButton(saveButton); notesAndToolsContainer = new JPanel(); - BoxLayout contentAndToolsLayout = new BoxLayout(notesAndToolsContainer, BoxLayout.PAGE_AXIS); + BoxLayout contentAndToolsLayout = new BoxLayout(notesAndToolsContainer, BoxLayout.Y_AXIS); notesAndToolsContainer.setLayout(contentAndToolsLayout); notesContainer = new VerticalScrollablePanel(); BoxLayout layout = new BoxLayout(notesContainer, BoxLayout.Y_AXIS); notesContainer.setLayout(layout); - notesScrollPane = new ThermostatScrollPane(notesContainer); - int padding = Constants.PADDING; - notesScrollPane.setBorder(new EmptyBorder(padding, padding, padding, padding)); + notesScrollPane = new ThermostatScrollPane(notesContainer) { + @Override + public Dimension getMaximumSize() { + int width = (int) super.getMaximumSize().getWidth(); + return new Dimension(width, (int) this.getPreferredSize().getHeight()); + } + }; + notesAndToolsContainer.add(notesScrollPane); JButton addNewNoteButton = new JButton("Add");