mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 06:50:56 +03:00
ComboBox: fixed popup location if shown above of combo box (Java 8 only)
This commit is contained in:
@@ -21,6 +21,7 @@ FlatLaf Change Log
|
||||
`StringBuilder`, `StringBuffer`, or any other object that returns HTML text in
|
||||
method `toString()`. (similar to issue #12)
|
||||
- ComboBox: Fixed popup border painting on HiDPI screens (e.g. at 150% scaling).
|
||||
- ComboBox: Fixed popup location if shown above of combo box (Java 8 only).
|
||||
- ComboBox (editable): Fixed wrong border of internal text field under special
|
||||
circumstances.
|
||||
- Spinner: Fixed painting of border corners on left side. (issue #382;
|
||||
|
||||
@@ -730,6 +730,21 @@ public class FlatComboBoxUI
|
||||
return height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show( Component invoker, int x, int y ) {
|
||||
// Java 8: fix y coordinate if popup is shown above the combobox
|
||||
// (already fixed in Java 9+ https://bugs.openjdk.java.net/browse/JDK-7072653)
|
||||
if( y < 0 && !SystemInfo.isJava_9_orLater ) {
|
||||
Border popupBorder = getBorder();
|
||||
if( popupBorder != null ) {
|
||||
Insets insets = popupBorder.getBorderInsets( this );
|
||||
y -= insets.top + insets.bottom;
|
||||
}
|
||||
}
|
||||
|
||||
super.show( invoker, x, y );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintChildren( Graphics g ) {
|
||||
super.paintChildren( g );
|
||||
|
||||
Reference in New Issue
Block a user