mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Yosemite LaF: fix background painting for text fields
This commit is contained in:
+17
-1
@@ -24,6 +24,7 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.Gray;
|
||||
import com.intellij.util.ui.JBInsets;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.Border;
|
||||
@@ -108,11 +109,26 @@ public class MacIntelliJTextFieldUI extends TextFieldWithPopupHandlerUI {
|
||||
if (isSearchField(c)) {
|
||||
paintSearchField(g, c, r);
|
||||
} else {
|
||||
super.paintBackground(g);
|
||||
if (c.getBorder() instanceof MacIntelliJTextBorder) {
|
||||
g.setColor(c.getBackground());
|
||||
g.fillRect(3, 3, c.getWidth() - 6, c.getHeight() - 6);
|
||||
} else {
|
||||
super.paintBackground(g);
|
||||
}
|
||||
}
|
||||
config.restore();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Dimension getPreferredSize(JComponent c) {
|
||||
Dimension size = super.getPreferredSize(c);
|
||||
if (c.getBorder() instanceof MacIntelliJTextBorder) {
|
||||
return new Dimension(size.width + 8, 26);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
protected void paintDarculaBackground(Graphics2D g, JTextComponent c, Border border) {
|
||||
if (c.isEnabled() && c.isEditable()) {
|
||||
g.setColor(c.getBackground());
|
||||
|
||||
Reference in New Issue
Block a user