Browse Source

CHART-13064 修改含有自动button的颜色选择器高度

feature/big-screen
Qinghui.Liu 5 years ago
parent
commit
c4e900ef74
  1. 10
      designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java
  2. 12
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

10
designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java

@ -16,6 +16,7 @@ import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -46,6 +47,8 @@ public abstract class ColorControlWindowWithAuto extends ColorControlWindow {
class ColorSelectionPopupPaneWithAuto extends NewColorSelectPane {
private static final long serialVersionUID = 7822856562329146354L;
private final static int BUTTON_HEIGHT = 15;
public ColorSelectionPopupPaneWithAuto(boolean isSupportTransparent) {
super(isSupportTransparent);
@ -111,6 +114,13 @@ public abstract class ColorControlWindowWithAuto extends ColorControlWindow {
}
}
public Dimension getPreferredSize() {
if (isSupportTransparent()) {
return new Dimension(super.getPreferredSize().width, TRANSPARENT_WINDOW_HEIGHT + BUTTON_HEIGHT);
}
return new Dimension(super.getPreferredSize().width, WINDOW_HEIGHT + BUTTON_HEIGHT);
}
}
}

12
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

@ -40,8 +40,8 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
// 是否支持透明
private boolean isSupportTransparent;
private final static int TRANSPANENT_WINDOW_HEIGHT = 165;
private final static int WINDWO_HEIGHT = 150;
public final static int TRANSPARENT_WINDOW_HEIGHT = 165;
public final static int WINDOW_HEIGHT = 150;
// 最近使用颜色
private UsedColorPane usedColorPane;
@ -105,6 +105,10 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
centerPane.add(centerPane1);
}
public boolean isSupportTransparent() {
return isSupportTransparent;
}
public void setSupportTransparent(boolean supportTransparent) {
isSupportTransparent = supportTransparent;
}
@ -208,9 +212,9 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
@Override
public Dimension getPreferredSize() {
if (isSupportTransparent) {
return new Dimension(super.getPreferredSize().width, TRANSPANENT_WINDOW_HEIGHT);
return new Dimension(super.getPreferredSize().width, TRANSPARENT_WINDOW_HEIGHT);
}
return new Dimension(super.getPreferredSize().width, WINDWO_HEIGHT);
return new Dimension(super.getPreferredSize().width, WINDOW_HEIGHT);
}
/**

Loading…
Cancel
Save