Skip to content

Commit

Permalink
#279: Implemented edits suggested by Ryan
Browse files Browse the repository at this point in the history
  • Loading branch information
flaw600 committed Dec 29, 2016
1 parent 6381961 commit a7e75e2
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,19 @@ public InstanceInstallerDialog(Object object, final boolean isUpdate, final bool
break;
}
}

// ensures that font width is taken into account
for (PackVersion version : versions) {
versionLength = Math.max(versionLength, version.toString().length());
versionLength = Math.max(versionLength, getFontMetrics(Utils.getFont()).stringWidth(version.toString()) + 254);
}
versionsDropDown.setPreferredSize(new Dimension(versionLength+20, 25));

// ensures that the dropdown is at least 200 px wide
versionLength = Math.max(200, versionLength);

// ensures that there is a maximum width
versionLength = Math.min(250, versionLength);

versionsDropDown.setPreferredSize(new Dimension(versionLength, 25));
middle.add(versionsDropDown, gbc);

if (autoInstallVersion != null) {
Expand Down

0 comments on commit a7e75e2

Please sign in to comment.