mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
reverted transparent progress in completion for Peter, see IDEA-142801
This commit is contained in:
@@ -47,6 +47,7 @@ import com.intellij.ui.components.JBScrollPane;
|
||||
import com.intellij.util.Alarm;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import com.intellij.util.ui.AbstractLayoutManager;
|
||||
import com.intellij.util.ui.AsyncProcessIcon;
|
||||
import com.intellij.util.ui.ButtonlessScrollBarUI;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
@@ -77,6 +78,8 @@ class LookupUi {
|
||||
private final JLabel mySortingLabel = new JLabel();
|
||||
private final JScrollPane myScrollPane;
|
||||
private final JButton myScrollBarIncreaseButton;
|
||||
private final AsyncProcessIcon myProcessIcon = new AsyncProcessIcon("Completion progress");
|
||||
private final JPanel myIconPanel = new JPanel(new BorderLayout());
|
||||
private final LookupLayeredPane myLayeredPane = new LookupLayeredPane();
|
||||
|
||||
private LookupHint myElementHint = null;
|
||||
@@ -89,6 +92,10 @@ class LookupUi {
|
||||
myList = list;
|
||||
myProject = project;
|
||||
|
||||
myIconPanel.setVisible(false);
|
||||
myIconPanel.setBackground(Color.LIGHT_GRAY);
|
||||
myIconPanel.add(myProcessIcon);
|
||||
|
||||
JComponent adComponent = advertiser.getAdComponent();
|
||||
adComponent.setBorder(new EmptyBorder(0, 1, 1, 2 + AllIcons.Ide.LookupRelevance.getIconWidth()));
|
||||
myLayeredPane.mainPanel.add(adComponent, BorderLayout.SOUTH);
|
||||
@@ -125,6 +132,7 @@ class LookupUi {
|
||||
|
||||
updateScrollbarVisibility();
|
||||
|
||||
Disposer.register(lookup, myProcessIcon);
|
||||
Disposer.register(lookup, myHintAlarm);
|
||||
}
|
||||
|
||||
@@ -220,7 +228,7 @@ class LookupUi {
|
||||
Runnable setVisible = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
myList.setPaintBusy(myLookup.isCalculating());
|
||||
myIconPanel.setVisible(myLookup.isCalculating());
|
||||
}
|
||||
};
|
||||
if (myLookup.isCalculating()) {
|
||||
@@ -228,6 +236,12 @@ class LookupUi {
|
||||
} else {
|
||||
setVisible.run();
|
||||
}
|
||||
|
||||
if (calculating) {
|
||||
myProcessIcon.resume();
|
||||
} else {
|
||||
myProcessIcon.suspend();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateSorting() {
|
||||
@@ -325,6 +339,7 @@ class LookupUi {
|
||||
|
||||
private LookupLayeredPane() {
|
||||
add(mainPanel, 0, 0);
|
||||
add(myIconPanel, 42, 0);
|
||||
add(mySortingLabel, 10, 0);
|
||||
|
||||
setLayout(new AbstractLayoutManager() {
|
||||
@@ -379,6 +394,10 @@ class LookupUi {
|
||||
vScrollBar.revalidate();
|
||||
vScrollBar.repaint();
|
||||
|
||||
final Dimension iconSize = myProcessIcon.getPreferredSize();
|
||||
myIconPanel.setBounds(getWidth() - iconSize.width - (vScrollBar.isVisible() ? vScrollBar.getWidth() : 0), 0, iconSize.width,
|
||||
iconSize.height);
|
||||
|
||||
final Dimension sortSize = mySortingLabel.getPreferredSize();
|
||||
final int sortWidth = vScrollBar.isVisible() ? vScrollBar.getWidth() : sortSize.width;
|
||||
final int sortHeight = Math.max(sortSize.height, adHeight);
|
||||
|
||||
Reference in New Issue
Block a user