From 18f25fe7d09b34eaf8b9788c0fc0c41f0dbaa412 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Tue, 13 Mar 2018 12:07:50 +0300 Subject: [PATCH] IDEA-185543 increase height of the GoToClass popup --- .../intellij/ide/util/gotoByName/ChooseByNameBase.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java index 3b037fe4c624..0852b75a5cab 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java @@ -125,7 +125,6 @@ public abstract class ChooseByNameBase { private final String[][] myNames = new String[2][]; private volatile CalcElementsThread myCalcElementsThread; - private static int VISIBLE_LIST_SIZE_LIMIT = 10; private int myListSizeIncreasing = 30; private int myMaximumListSizeLimit = 30; @NonNls private static final String NOT_FOUND_IN_PROJECT_CARD = "syslib"; @@ -624,6 +623,7 @@ public abstract class ChooseByNameBase { //noinspection unchecked myList.setCellRenderer(myModel.getListCellRenderer()); + myList.setVisibleRowCount(16); myList.setFont(editorFont); myList.addListSelectionListener(new ListSelectionListener() { @@ -806,9 +806,6 @@ public abstract class ChooseByNameBase { final int paneHeight = layeredPane.getHeight(); final int y = paneHeight / 3 - preferredTextFieldPanelSize.height / 2; - VISIBLE_LIST_SIZE_LIMIT = Math.max - (10, (paneHeight - (y + preferredTextFieldPanelSize.height)) / (preferredTextFieldPanelSize.height / 2) - 1); - ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(myTextFieldPanel, myTextField); builder.setLocateWithinScreenBounds(false); builder.setKeyEventHandler(event -> { @@ -969,12 +966,10 @@ public abstract class ChooseByNameBase { myTextField.setForeground(UIUtil.getTextFieldForeground()); if (commands == null || commands.isEmpty()) { applySelection(pos); - myList.setVisibleRowCount(Math.min(VISIBLE_LIST_SIZE_LIMIT, myList.getModel().getSize())); showList(); myTextFieldPanel.repositionHint(); } else { - showList(); appendToModel(commands, pos); } } @@ -1032,8 +1027,6 @@ public abstract class ChooseByNameBase { for (ModelDiff.Cmd command : commands) { command.apply(); } - - myList.setVisibleRowCount(Math.min(VISIBLE_LIST_SIZE_LIMIT, myList.getModel().getSize())); showList(); myTextFieldPanel.repositionHint();