Browse Source

REPORT-1096 取色板=》调整代码

master
plough 8 years ago
parent
commit
e596f2aca7
  1. 12
      designer_base/src/com/fr/design/style/color/ColorPicker.java

12
designer_base/src/com/fr/design/style/color/ColorPicker.java

@ -112,12 +112,10 @@ public class ColorPicker extends JDialog implements ActionListener
validate(); // 更新所有子控件 validate(); // 更新所有子控件
} }
public void pickComplete(Boolean setColor) { public void pickComplete(Color color) {
timer.stop(); timer.stop();
if (setColor) { if (color != null) {
colorSelectable.setColor(colorToSet); colorSelectable.setColor(color);
} else if (setColorRealTime) {
colorSelectable.setColor(initColor);
} }
this.dispose(); this.dispose();
} }
@ -134,9 +132,9 @@ public class ColorPicker extends JDialog implements ActionListener
public void mousePressed(MouseEvent e) public void mousePressed(MouseEvent e)
{ {
if (e.getButton() == e.BUTTON1) { // 左键确定 if (e.getButton() == e.BUTTON1) { // 左键确定
pickComplete(true); pickComplete(colorToSet);
} else { } else {
pickComplete(false); pickComplete(setColorRealTime ? initColor : null);
} }
} }
} }

Loading…
Cancel
Save