mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-16 02:43:20 +00:00
8203281: [Windows] JComboBox change in ui when editor.setBorder() is called
Reviewed-by: psadhukhan
This commit is contained in:
parent
88a48fe2a6
commit
0f45d2d52a
@ -154,7 +154,7 @@ public class WindowsComboBoxUI extends BasicComboBoxUI {
|
||||
comboBox.addMouseListener(rolloverListener);
|
||||
arrowButton.addMouseListener(rolloverListener);
|
||||
// set empty border as default to see vista animated border
|
||||
comboBox.setBorder(new EmptyBorder(0,0,0,0));
|
||||
comboBox.setBorder(new EmptyBorder(1,1,1,1));
|
||||
}
|
||||
}
|
||||
|
||||
@ -366,12 +366,20 @@ public class WindowsComboBoxUI extends BasicComboBoxUI {
|
||||
if (XPStyle.getXP() != null && arrowButton != null) {
|
||||
Dimension d = parent.getSize();
|
||||
Insets insets = getInsets();
|
||||
int buttonWidth = arrowButton.getPreferredSize().width;
|
||||
arrowButton.setBounds(WindowsGraphicsUtils.isLeftToRight((JComboBox)parent)
|
||||
? (d.width - insets.right - buttonWidth)
|
||||
: insets.left,
|
||||
insets.top,
|
||||
buttonWidth, d.height - insets.top - insets.bottom);
|
||||
|
||||
int borderInsetsCorrection = 0;
|
||||
if (((JComboBox)parent).getBorder() instanceof EmptyBorder) {
|
||||
borderInsetsCorrection = 1;
|
||||
}
|
||||
arrowButton.setBounds(
|
||||
WindowsGraphicsUtils.isLeftToRight((JComboBox)parent)
|
||||
? (d.width - (insets.right - borderInsetsCorrection)
|
||||
- arrowButton.getPreferredSize().width)
|
||||
: insets.left - borderInsetsCorrection,
|
||||
insets.top - borderInsetsCorrection,
|
||||
arrowButton.getPreferredSize().width,
|
||||
d.height - (insets.top - borderInsetsCorrection) -
|
||||
(insets.bottom - borderInsetsCorrection));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -672,8 +672,8 @@ public class WindowsLookAndFeel extends BasicLookAndFeel
|
||||
"ComboBox.buttonHighlight", ControlHighlightColor,
|
||||
"ComboBox.selectionBackground", SelectionBackgroundColor,
|
||||
"ComboBox.selectionForeground", SelectionTextColor,
|
||||
"ComboBox.editorBorder", new XPValue(new EmptyBorder(1,4,1,1),
|
||||
new EmptyBorder(1,4,1,4)),
|
||||
"ComboBox.editorBorder", new XPValue(new EmptyBorder(1,3,1,1),
|
||||
new EmptyBorder(1,3,1,4)),
|
||||
"ComboBox.disabledBackground",
|
||||
new XPColorValue(Part.CP_COMBOBOX, State.DISABLED,
|
||||
Prop.FILLCOLOR, DisabledTextBackground),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user