Browse Source

REPORT-4978 [9.0二轮回归]设计器控件设置界面,控件图标显示有问题,左边被遮挡

master
plough 7 years ago
parent
commit
7f2b3eec2a
  1. 6
      designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java
  2. 5
      designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java

6
designer_base/src/com/fr/design/gui/icombobox/UIComboBoxUI.java

@ -94,6 +94,10 @@ public class UIComboBoxUI extends BasicComboBoxUI implements MouseListener {
*/ */
@Override @Override
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) { public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) {
paintCurrentValue(g, bounds, hasFocus, 0);
}
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus, int paddingLeft) {
ListCellRenderer renderer = comboBox.getRenderer(); ListCellRenderer renderer = comboBox.getRenderer();
Component c; Component c;
@ -142,7 +146,7 @@ public class UIComboBoxUI extends BasicComboBoxUI implements MouseListener {
int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height; int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
currentValuePane.paintComponent(g, c, comboBox, x, y, w, h, shouldValidate); currentValuePane.paintComponent(g, c, comboBox, x + paddingLeft, y, w, h, shouldValidate);
} }
@Override @Override

5
designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java

@ -121,6 +121,11 @@ public class UITreeComboBox extends UIComboBox {
protected ComboPopup createPopup() { protected ComboPopup createPopup() {
return new TreePopup(comboBox); return new TreePopup(comboBox);
} }
@Override
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) {
paintCurrentValue(g, bounds, hasFocus, 3);
}
} }
class MotifJTreeComboBoxUI extends MotifComboBoxUI{ class MotifJTreeComboBoxUI extends MotifComboBoxUI{

Loading…
Cancel
Save