GP-1410 fix scroll bars in userlist of shared project

This commit is contained in:
dev747368 2021-10-18 13:02:15 -04:00
parent f9463e600d
commit 5912d6bbea

View file

@ -482,6 +482,7 @@ public class ProjectAccessPanel extends AbstractWizardJPanel {
* Panel for displaying the list of users with repository access. * Panel for displaying the list of users with repository access.
*/ */
class KnownUsersPanel extends JPanel { class KnownUsersPanel extends JPanel {
private static final int DEFAULT_USERLIST_ROWS_TO_SHOW = 20;
private JList<String> userList; private JList<String> userList;
private DefaultListModel<String> listModel; private DefaultListModel<String> listModel;
@ -514,6 +515,8 @@ public class ProjectAccessPanel extends AbstractWizardJPanel {
// Set the minimum dimensions of the scroll pane so we can't collapse it. // Set the minimum dimensions of the scroll pane so we can't collapse it.
Dimension d = userList.getPreferredSize(); Dimension d = userList.getPreferredSize();
d.width = 100; d.width = 100;
d.height =
Math.min(userList.getFixedCellHeight() * DEFAULT_USERLIST_ROWS_TO_SHOW, d.height);
sp.setPreferredSize(d); sp.setPreferredSize(d);
sp.setMinimumSize(new Dimension(100, 200)); sp.setMinimumSize(new Dimension(100, 200));