win10 combobox border

This commit is contained in:
Konstantin Bulenkov
2016-06-01 22:36:41 +02:00
parent a61abafc44
commit 0a927a2857
2 changed files with 11 additions and 4 deletions
@@ -22,6 +22,7 @@ import com.intellij.util.ui.JBUI;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicArrowButton;
import java.awt.*;
/**
@@ -78,7 +79,7 @@ public class WinIntelliJComboBoxUI extends DarculaComboBoxUI {
@Override
protected JButton createArrowButton() {
final JButton button = new JButton() {
final JButton button = new BasicArrowButton(SwingConstants.SOUTH) {
@Override
public Dimension getPreferredSize() {
return JBUI.size(14, 6);
@@ -92,8 +93,7 @@ public class WinIntelliJComboBoxUI extends DarculaComboBoxUI {
}
};
button.setOpaque(false);
button.setFocusable(false);
button.setBorder(null);
button.setBorder(JBUI.Borders.empty());
return button;
}
@@ -102,7 +102,13 @@ public class WinIntelliJComboBoxUI extends DarculaComboBoxUI {
if (comboBox == null || arrowButton == null) {
return; //NPE on LaF change
}
g2.setColor(UIManager.getColor("ComboBox.borderColor"));
hasFocus = false;
checkFocus();
if (hasFocus) {
g2.setColor(UIManager.getColor("ComboBox.activeBorderColor"));
} else {
g2.setColor(UIManager.getColor("ComboBox.borderColor"));
}
g2.drawRect(x + 1, y + 1, width - 2, height - 2);
}
}
@@ -112,6 +112,7 @@ ComboBox.disabledBackground=e1e1e1
ComboBox.disabledForeground=777777
ComboBox.squareButton=false
ComboBox.borderColor=adadad
ComboBox.activeBorderColor=0078d7
ComboBox.background=ffffff
ComboBox.darcula.arrowFillColor=457dd7
ComboBox.darcula.arrowFocusedFillColor=2d82ed