|
|
|
@ -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); |
|
|
|
|
} |
|
|
|
|
} |