Browse Source

Pull request #13393: REPORT-111740 【控件显示增强】历史模板升级后,工具栏没有根据背景适配深浅

Merge in DESIGN/design from ~OBO/design1:release/11.0 to release/11.0

* commit '28011b7151f5b2edd9b829682207e74ec73ed805':
  方法名也改下,以及成员变量名
  改下命名,颜色深浅模式可以作为公共枚举使用,并且层级往上抽一下
  改为枚举实现
  REPORT-111740 【控件显示增强】历史模板升级后,工具栏没有根据背景适配深浅
release/11.0
Obo-王学仁 11 months ago
parent
commit
2bc866691e
  1. 9
      designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java
  2. 13
      designer-realize/src/main/java/com/fr/design/webattr/FToolBar.java
  3. 2
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarPane.java

9
designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java

@ -30,6 +30,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.IconDefinePane; import com.fr.design.widget.IconDefinePane;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.CustomToolBarButton; import com.fr.form.ui.CustomToolBarButton;
import com.fr.general.ColorMode;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetInfoConfig; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.Background; import com.fr.general.Background;
@ -227,7 +228,7 @@ public class EditToolBar extends BasicPane {
this.defaultCheckBox.setSelected(ftoolbar.isDefault() ? true : false); this.defaultCheckBox.setSelected(ftoolbar.isDefault() ? true : false);
if (bgColorButtonGroup != null) { if (bgColorButtonGroup != null) {
this.bgColorButtonGroup.setSelectedIndex(ftoolbar.isBgColorLight() ? 0 : 1); this.bgColorButtonGroup.setSelectedIndex(ftoolbar.getButtonBgColorMode().getCode());
} }
} }
@ -263,7 +264,7 @@ public class EditToolBar extends BasicPane {
ftoolBar.setBackground(this.background); ftoolBar.setBackground(this.background);
} }
if (bgColorButtonGroup != null) { if (bgColorButtonGroup != null) {
ftoolBar.setBgColorLight(bgColorButtonGroup.getSelectedIndex() == 0); ftoolBar.setButtonBgColorMode(ColorMode.getModeByCode(bgColorButtonGroup.getSelectedIndex()));
} }
return ftoolBar; return ftoolBar;
} }
@ -729,7 +730,9 @@ public class EditToolBar extends BasicPane {
private JPanel createButtonColorGroup() { private JPanel createButtonColorGroup() {
UILabel headLabel = new UILabel(Toolkit.i18nText("Fine-Design_ToolBar_Button_Color")); UILabel headLabel = new UILabel(Toolkit.i18nText("Fine-Design_ToolBar_Button_Color"));
String[] titles = new String[]{Toolkit.i18nText("Fine-Design_ToolBar_Button_Color_Light"), Toolkit.i18nText("Fine-Design_ToolBar_Button_Color_Dark")}; String[] titles = new String[]{ Toolkit.i18nText("Fine-Design_ToolBar_Button_Color_Auto"),
Toolkit.i18nText("Fine-Design_ToolBar_Button_Color_Light"),
Toolkit.i18nText("Fine-Design_ToolBar_Button_Color_Dark")};
bgColorButtonGroup = new UIButtonGroup<String>(titles) { bgColorButtonGroup = new UIButtonGroup<String>(titles) {
@Override @Override
public void setSelectedIndex(int newSelectedIndex, boolean fireChanged) { public void setSelectedIndex(int newSelectedIndex, boolean fireChanged) {

13
designer-realize/src/main/java/com/fr/design/webattr/FToolBar.java

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.fr.form.ui.ToolBar; import com.fr.form.ui.ToolBar;
import com.fr.general.ColorMode;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.Background; import com.fr.general.Background;
@ -12,7 +13,7 @@ public class FToolBar {
private Background background = null; private Background background = null;
private boolean isDefault = true; private boolean isDefault = true;
private boolean buttonBgColorLight = true; private ColorMode buttonBgColorMode = ColorMode.AUTO;
public List<ToolBarButton> getButtonlist() { public List<ToolBarButton> getButtonlist() {
return buttonlist; return buttonlist;
} }
@ -53,12 +54,12 @@ public class FToolBar {
this.isDefault = isDefault; this.isDefault = isDefault;
} }
public boolean isBgColorLight() { public ColorMode getButtonBgColorMode() {
return buttonBgColorLight; return buttonBgColorMode;
} }
public void setBgColorLight(boolean bgColorLight) { public void setButtonBgColorMode(ColorMode buttonBgColorMode) {
this.buttonBgColorLight = bgColorLight; this.buttonBgColorMode = buttonBgColorMode;
} }
public ToolBar getToolBar() { public ToolBar getToolBar() {
@ -69,7 +70,7 @@ public class FToolBar {
ToolBar toolBar = new ToolBar(n); ToolBar toolBar = new ToolBar(n);
toolBar.setBackground(this.background); toolBar.setBackground(this.background);
toolBar.setDefault(this.isDefault); toolBar.setDefault(this.isDefault);
toolBar.setButtonBgColorLight(this.buttonBgColorLight); toolBar.setButtonBgColorMode(this.buttonBgColorMode);
return toolBar; return toolBar;
} }
} }

2
designer-realize/src/main/java/com/fr/design/webattr/ToolBarPane.java

@ -157,7 +157,7 @@ public class ToolBarPane extends BasicBeanPane<ToolBar> {
} }
this.getFToolBar().setBackground(toolbar.getBackground()); this.getFToolBar().setBackground(toolbar.getBackground());
this.getFToolBar().setDefault(toolbar.isDefault()); this.getFToolBar().setDefault(toolbar.isDefault());
this.getFToolBar().setBgColorLight(toolbar.isButtonBgColorLight()); this.getFToolBar().setButtonBgColorMode(toolbar.getButtonBgColorMode());
setPopulateFinished(true); setPopulateFinished(true);
} }

Loading…
Cancel
Save