Browse Source

回退主题控件深浅配置

feature/x
obo 1 year ago
parent
commit
78c5d8da3e
  1. 33
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java
  2. 4
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java
  3. 2
      designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java
  4. 2
      designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCellWithIcon.java
  5. 4
      designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java

33
designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java

@ -28,12 +28,6 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
protected UIRadioButton style1; protected UIRadioButton style1;
// 风格2 // 风格2
protected UIRadioButton style2; protected UIRadioButton style2;
// 控件深浅主题 自动
protected UIRadioButton widgetThemeAuto;
// 控件深浅主题 深色
protected UIRadioButton widgetThemeDark;
// 控件深浅主题 浅色
protected UIRadioButton widgetThemeLight;
public DesktopWidgetStyleEditPane() { public DesktopWidgetStyleEditPane() {
super(); super();
@ -47,17 +41,12 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
stylePane.add(style1); stylePane.add(style1);
stylePane.add(style2); stylePane.add(style2);
JPanel widgetThemePane = new JPanel(FRGUIPaneFactory.createBoxFlowLayout());
widgetThemePane.add(widgetThemeAuto);
widgetThemePane.add(widgetThemeDark);
widgetThemePane.add(widgetThemeLight);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Color")), colorSelectBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Color")), colorSelectBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Style")), stylePane}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Style")), stylePane},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Line")), lineComboBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Line")), lineComboBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Font_Size")), fontSizeComoBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Font_Size")), fontSizeComoBox}
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Theme_Widget_Theme")), widgetThemePane},
}; };
return components; return components;
} }
@ -69,14 +58,6 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
ButtonGroup buttonGroup = new ButtonGroup(); ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(style1); buttonGroup.add(style1);
buttonGroup.add(style2); buttonGroup.add(style2);
widgetThemeAuto = new UIRadioButton(Toolkit.i18nText("Fine-Design_Theme_Widget_Theme_Auto"));
widgetThemeDark = new UIRadioButton(Toolkit.i18nText("Fine-Design_Widget_Theme_Dark"));
widgetThemeLight = new UIRadioButton(Toolkit.i18nText("Fine-Design_Theme_Widget_Theme_Light"));
ButtonGroup widgetThemeGroup = new ButtonGroup();
widgetThemeGroup.add(widgetThemeAuto);
widgetThemeGroup.add(widgetThemeDark);
widgetThemeGroup.add(widgetThemeLight);
} }
@Override @Override
@ -91,17 +72,6 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
} else { } else {
style2.setSelected(true); style2.setSelected(true);
} }
switch (style.getWidgetThemeType()) {
case 1:
widgetThemeDark.setSelected(true);
break;
case 2:
widgetThemeLight.setSelected(true);
break;
default:
widgetThemeAuto.setSelected(true);
break;
}
colorSelectBox.setSelectObject(style.getThemeColor()); colorSelectBox.setSelectObject(style.getThemeColor());
lineComboBox.setSelectedLineStyle(style.getBorderStyle().getLineType()); lineComboBox.setSelectedLineStyle(style.getBorderStyle().getLineType());
borderRadiusSpinner.setValue(style.getBorderStyle().getRadius()); borderRadiusSpinner.setValue(style.getBorderStyle().getRadius());
@ -131,6 +101,5 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
buttonBackgroundStyle.setClickBackground(buttonBackground); buttonBackgroundStyle.setClickBackground(buttonBackground);
style.setButtonBackgroundStyle(buttonBackgroundStyle); style.setButtonBackgroundStyle(buttonBackgroundStyle);
style.setStyleType(style1.isSelected() ? 1 : 2); style.setStyleType(style1.isSelected() ? 1 : 2);
style.setWidgetThemeType(widgetThemeAuto.isSelected() ? 0 : widgetThemeDark.isSelected() ? 1 : 2);
} }
} }

4
designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java

@ -52,9 +52,9 @@ public class WidgetStyleEditPane<T extends TemplateTheme> extends BasicBeanPane<
initCommonStyleEditor(); initCommonStyleEditor();
double f = TableLayout.PREFERRED; double f = TableLayout.PREFERRED;
final double p = TableLayout.PREFERRED; final double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, p}; double[] columnSize = {p, p};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] components = generateComponent(); Component[][] components = generateComponent();
JPanel customPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); JPanel customPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
customPane.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 10)); customPane.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 10));

2
designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java

@ -88,7 +88,7 @@ public class ControlPreviewCell extends JPanel {
public boolean isDefaultStyle() { public boolean isDefaultStyle() {
ThemedWidgetStyle widgetStyle = (ThemedWidgetStyle) reportTheme.getWidgetStyle(); ThemedWidgetStyle widgetStyle = (ThemedWidgetStyle) reportTheme.getWidgetStyle();
return widgetStyle.getStyleType() == WidgetThemeDisplayConstants.DEFAULT_STYLE; return widgetStyle.getStyleType() == ThemedWidgetStyle.DEFAULT_STYLE;
} }
public Color getThemeColor() { public Color getThemeColor() {

2
designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCellWithIcon.java

@ -70,7 +70,7 @@ public class ControlPreviewCellWithIcon extends ControlPreviewCell {
icon = setStyleTwoIcon(icon, defaultIcon); icon = setStyleTwoIcon(icon, defaultIcon);
this.jLabel.setIcon(icon); this.jLabel.setIcon(icon);
this.add(jLabel, BorderLayout.EAST); this.add(jLabel, BorderLayout.EAST);
if (widgetStyle.getStyleType() != WidgetThemeDisplayConstants.DEFAULT_STYLE) { if (widgetStyle.getStyleType() != ThemedWidgetStyle.DEFAULT_STYLE) {
paintBgColor(g, widgetStyle, CONTROL_ALPHA); paintBgColor(g, widgetStyle, CONTROL_ALPHA);
} }
} }

4
designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java

@ -212,7 +212,7 @@ public abstract class BaseStyleSettingPane<T extends Widget> extends BasicBeanPa
} }
} }
private void setStyle(ThemedWidgetStyle widgetStyle) { private void setStyle(ThemedWidgetStyle widgetStyle) {
if (widgetStyle.getStyleType() == WidgetThemeDisplayConstants.DEFAULT_STYLE) { if (widgetStyle.getStyleType() == ThemedWidgetStyle.DEFAULT_STYLE) {
if (style1 != null) { if (style1 != null) {
style1.setSelected(true); style1.setSelected(true);
} }
@ -254,7 +254,7 @@ public abstract class BaseStyleSettingPane<T extends Widget> extends BasicBeanPa
} }
private void setDefaultStyle() { private void setDefaultStyle() {
if (colorSelectBox != null) { if (colorSelectBox != null) {
colorSelectBox.setSelectObject(WidgetThemeDisplayConstants.DEFAULT_COLOR); colorSelectBox.setSelectObject(ThemedWidgetStyle.DEFAULT_COLOR);
} }
if (style1 != null) { if (style1 != null) {
style1.setSelected(true); style1.setSelected(true);

Loading…
Cancel
Save