Browse Source

REPORT-106312 【控件显示增强】增加深浅字体配置

release/11.0
obo 1 year ago
parent
commit
904c056e22
  1. 34
      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

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

@ -28,6 +28,12 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
protected UIRadioButton style1;
// 风格2
protected UIRadioButton style2;
// 控件深浅主题 自动
protected UIRadioButton widgetThemeAuto;
// 控件深浅主题 深色
protected UIRadioButton widgetThemeDark;
// 控件深浅主题 浅色
protected UIRadioButton widgetThemeLight;
public DesktopWidgetStyleEditPane() {
super();
@ -41,12 +47,17 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
stylePane.add(style1);
stylePane.add(style2);
JPanel widgetThemePane = new JPanel(FRGUIPaneFactory.createBoxFlowLayout());
widgetThemePane.add(widgetThemeAuto);
widgetThemePane.add(widgetThemeDark);
widgetThemePane.add(widgetThemeLight);
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_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_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;
}
@ -58,6 +69,14 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(style1);
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
@ -72,6 +91,18 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
} else {
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());
lineComboBox.setSelectedLineStyle(style.getBorderStyle().getLineType());
borderRadiusSpinner.setValue(style.getBorderStyle().getRadius());
@ -101,5 +132,6 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
buttonBackgroundStyle.setClickBackground(buttonBackground);
style.setButtonBackgroundStyle(buttonBackgroundStyle);
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();
double f = TableLayout.PREFERRED;
final double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p};
double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p, p};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] components = generateComponent();
JPanel customPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
customPane.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 10));

Loading…
Cancel
Save