Skip to content

Commit

Permalink
Merge pull request #259 from Wolfsblvt/Fix_Confirm_Window
Browse files Browse the repository at this point in the history
Fix confirm window getting too big for screen
  • Loading branch information
Ljaysoft authored Aug 16, 2016
2 parents f910f60 + 7730158 commit 3b6caf3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/me/corriekay/pokegoutil/windows/PokemonTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,13 @@ private JPanel _buildPanelForOperation(String operation, ArrayList<Pokemon> poke

JScrollPane scroll = new JScrollPane(innerPanel);
scroll.setAlignmentX(CENTER_ALIGNMENT);
scroll.setMaximumSize(new Dimension(Integer.MAX_VALUE, 150));

panel.setMaximumSize(panel.getSize());
// Auto-height? Resizable? Haha. Funny joke.
// I hate swing. But we need to get around here some way.
// So lets get dirty.
// We take 20 px for each row, 5 px buffer, and cap that at may 400 pixel.
int height = Math.min(400, pokes.size() * 20 + 5);
panel.setPreferredSize(new Dimension(500, height));

pokes.forEach(p -> {
String str = PokeHandler.getLocalPokeName(p) + " - CP: " + p.getCp() + ", IV: "
Expand Down

0 comments on commit 3b6caf3

Please sign in to comment.