mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
revert due to SOE
This commit is contained in:
@@ -383,15 +383,13 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
public Dimension getPreferredSize() {
|
||||
final boolean isEmpty = getIcon() == null && StringUtil.isEmpty(getText());
|
||||
int width = isEmpty ? JBUI.scale(10) + getArrowIcon(isEnabled()).getIconWidth() : super.getPreferredSize().width;
|
||||
if (isSmallVariant() && !UIUtil.isUnderDefaultMacTheme()) {
|
||||
if (isSmallVariant() && !((SystemInfo.isMac && UIUtil.isUnderIntelliJLaF()))) {
|
||||
width += JBUI.scale(4);
|
||||
if (UIUtil.isUnderWin10LookAndFeel()) {
|
||||
width += JBUI.scale(8);
|
||||
}
|
||||
}
|
||||
|
||||
int height = UIUtil.isUnderWin10LookAndFeel() ? JBUI.scale(22) : JBUI.scale(19);
|
||||
return new Dimension(width, isSmallVariant() ? height : super.getPreferredSize().height);
|
||||
return new Dimension(width, isSmallVariant() ? JBUI.scale(19) : super.getPreferredSize().height);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -405,7 +403,7 @@ public abstract class ComboBoxAction extends AnAction implements CustomComponent
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
public void paint(Graphics g) {
|
||||
final boolean isEmpty = getIcon() == null && StringUtil.isEmpty(getText());
|
||||
final Dimension size = getSize();
|
||||
|
||||
|
||||
+6
-9
@@ -377,10 +377,6 @@ public class WinIntelliJComboBoxUI extends DarculaComboBoxUI {
|
||||
|
||||
editorHoverListener = new DarculaUIUtil.MouseHoverPropertyTrigger(comboBox, HOVER_PROPERTY);
|
||||
|
||||
JComponent jEditor = (JComponent)editor;
|
||||
jEditor.setOpaque(false);
|
||||
jEditor.setBorder(DEFAULT_EDITOR_BORDER);
|
||||
|
||||
if (editor instanceof JTextComponent) {
|
||||
editor.addFocusListener(editorFocusListener);
|
||||
editor.addMouseListener(editorHoverListener);
|
||||
@@ -390,10 +386,12 @@ public class WinIntelliJComboBoxUI extends DarculaComboBoxUI {
|
||||
etf.addFocusListener(editorFocusListener);
|
||||
etf.addMouseListener(editorHoverListener);
|
||||
etf.setBackground(getComboBackground(true));
|
||||
|
||||
jEditor.setBorder(JBUI.Borders.emptyTop(2));
|
||||
}
|
||||
}
|
||||
|
||||
JComponent jc = (JComponent)editor;
|
||||
jc.setBorder(DEFAULT_EDITOR_BORDER);
|
||||
jc.setOpaque(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -501,11 +499,10 @@ public class WinIntelliJComboBoxUI extends DarculaComboBoxUI {
|
||||
JBUI.insets(2, 6, 2, 2).asUIResource() : JBUI.insets(2, 2, 2, 6).asUIResource();
|
||||
}
|
||||
|
||||
private Dimension getSizeWithButton(Dimension d) {
|
||||
private Dimension getSizeWithButton(Dimension d) {
|
||||
Insets i = comboBox.getInsets();
|
||||
int width = ARROW_BUTTON_SIZE.width + i.left;
|
||||
return new Dimension(Math.max(d.width + JBUI.scale(10), width),
|
||||
Math.max(ARROW_BUTTON_SIZE.height, d.height));
|
||||
return new Dimension(Math.max(d.width + JBUI.scale(10), width), ARROW_BUTTON_SIZE.height);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-2
@@ -20,8 +20,10 @@ import com.intellij.ide.ui.laf.darcula.ui.DarculaTextBorder;
|
||||
import com.intellij.ide.ui.laf.darcula.ui.TextFieldWithPopupHandlerUI;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.ui.ColorPanel;
|
||||
import com.intellij.ui.components.panels.Wrapper;
|
||||
import com.intellij.util.ui.JBInsets;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@@ -29,7 +31,6 @@ import java.awt.geom.Path2D;
|
||||
|
||||
import static com.intellij.ide.ui.laf.darcula.ui.TextFieldWithPopupHandlerUI.isSearchFieldWithHistoryPopup;
|
||||
import static com.intellij.ide.ui.laf.intellij.WinIntelliJTextFieldUI.HOVER_PROPERTY;
|
||||
import static com.intellij.ide.ui.laf.intellij.WinIntelliJTextFieldUI.adjustInWrapperRect;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
@@ -54,7 +55,9 @@ public class WinIntelliJTextBorder extends DarculaTextBorder {
|
||||
try {
|
||||
Rectangle r = new Rectangle(x, y, width, height);
|
||||
|
||||
adjustInWrapperRect(r, c);
|
||||
if (UIUtil.getParentOfType(Wrapper.class, c) != null && isSearchFieldWithHistoryPopup(c)) {
|
||||
JBInsets.removeFrom(r, JBUI.insets(2, 0));
|
||||
}
|
||||
|
||||
JBInsets.removeFrom(r, JBUI.insets(1));
|
||||
|
||||
|
||||
+3
-11
@@ -95,19 +95,11 @@ public class WinIntelliJTextFieldUI extends DarculaTextFieldUI {
|
||||
if (UIUtil.getParentOfType(JSpinner.class, c) == null) { // Fill whole rectangle in spinner
|
||||
JBInsets.removeFrom(r, JBUI.insets(2));
|
||||
|
||||
adjustInWrapperRect(r, c);
|
||||
}
|
||||
g2.fill(r);
|
||||
}
|
||||
|
||||
static void adjustInWrapperRect(Rectangle r, Component c) {
|
||||
if (UIUtil.getParentOfType(Wrapper.class, c) != null && isSearchFieldWithHistoryPopup(c)) {
|
||||
int delta = c.getHeight() - c.getPreferredSize().height;
|
||||
if (delta > 0) {
|
||||
delta -= delta % 2 == 0 ? 0 : 1;
|
||||
JBInsets.removeFrom(r, JBUI.insets(delta / 2, 0));
|
||||
if (UIUtil.getParentOfType(Wrapper.class, c) != null && isSearchFieldWithHistoryPopup(c)) {
|
||||
JBInsets.removeFrom(r, JBUI.insets(2, 0));
|
||||
}
|
||||
}
|
||||
g2.fill(r);
|
||||
}
|
||||
|
||||
@Override public Dimension getPreferredSize(JComponent c) {
|
||||
|
||||
Reference in New Issue
Block a user