Platform: OS X scrollbars: completion sorter position fixed when there are scrollbars

This commit is contained in:
Anton Makeev
2014-06-23 12:32:20 +02:00
parent 2e5a6a0def
commit afd62613bd
@@ -377,18 +377,18 @@ class LookupUi {
myScrollBarIncreaseButton.setPreferredSize(buttonSize);
myScrollBarIncreaseButton.setMinimumSize(buttonSize);
myScrollBarIncreaseButton.setMaximumSize(buttonSize);
JScrollBar scrollBar = myScrollPane.getVerticalScrollBar();
scrollBar.revalidate();
scrollBar.repaint();
JScrollBar vScrollBar = myScrollPane.getVerticalScrollBar();
vScrollBar.revalidate();
vScrollBar.repaint();
final Dimension iconSize = myProcessIcon.getPreferredSize();
myIconPanel.setBounds(getWidth() - iconSize.width - (scrollBar.isVisible() ? scrollBar.getWidth() : 0), 0, iconSize.width, iconSize.height);
myIconPanel.setBounds(getWidth() - iconSize.width - (vScrollBar.isVisible() ? vScrollBar.getWidth() : 0), 0, iconSize.width,
iconSize.height);
final Dimension sortSize = mySortingLabel.getPreferredSize();
final Point sbLocation = SwingUtilities.convertPoint(scrollBar, 0, 0, myLayeredPane);
final int sortHeight = Math.max(adHeight, mySortingLabel.getPreferredSize().height);
mySortingLabel.setBounds(sbLocation.x, getHeight() - sortHeight, sortSize.width, sortHeight);
final int sortWidth = vScrollBar.isVisible() ? vScrollBar.getWidth() : sortSize.width;
final int sortHeight = Math.max(sortSize.height, adHeight);
mySortingLabel.setBounds(getWidth() - sortWidth, getHeight() - sortHeight, sortSize.width, sortHeight);
}
void layoutHint() {