Browse Source

REPORT-55850 【组件背景分离】组件复用-Tab组件背景和边框预览不生效

【问题原因】
1. Tab组件样式属性更新后,没有调用initStyl设置XCreator的样式重新渲染
2. Tab不支持圆角
3. Tab样式设置面板因为没有初始化标题相关配置项,导致update时,type变为默认值STANDARD,影响了
XWCardLayout.initStyle内部逻辑
【改动思路】
同上
final/10.0
Starryi 3 years ago
parent
commit
b2bf9dd2c4
  1. 5
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  2. 15
      designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java
  3. 6
      designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java

5
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -415,7 +415,10 @@ public class XWCardMainBorderLayout extends XWBorderLayout {
*/ */
@Override @Override
public void firePropertyChange(){ public void firePropertyChange(){
return; XWCardLayout cardLayout = this.getCardPart();
if (cardLayout != null && cardLayout.toData() != null) {
cardLayout.initStyle();
}
} }

15
designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java

@ -3,9 +3,7 @@
*/ */
package com.fr.design.gui.xpane; package com.fr.design.gui.xpane;
import com.fr.form.ui.LayoutBorderStyle; import javax.swing.JPanel;
import javax.swing.*;
/** /**
* CardTagLayoutBorderPane Pane. * CardTagLayoutBorderPane Pane.
@ -14,14 +12,13 @@ public class CardTagLayoutStylePane extends LayoutStylePane {
@Override @Override
protected JPanel createTitleStylePane(){ protected JPanel createTitleStylePane(){
return null; JPanel panel = super.createTitleStylePane();
panel.setVisible(false);
return panel;
} }
@Override @Override
public void updateTitle(LayoutBorderStyle style) { protected JPanel createBackgroundStylePane(boolean supportCornerRadius) {
return super.createBackgroundStylePane(false);
} }
@Override
protected void populateTitle() { }
} }

6
designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java

@ -110,7 +110,7 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
JPanel titlePane = createTitleStylePane(); JPanel titlePane = createTitleStylePane();
JPanel bodyContentPane = currentIsRootLayout ? createBodyContentPane4RootLayout() : createBodyContentPane(); JPanel bodyContentPane = currentIsRootLayout ? createBodyContentPane4RootLayout() : createBodyContentPane();
JPanel backgroundPane = createBackgroundStylePane(); JPanel backgroundPane = createBackgroundStylePane(true);
if (titlePane != null) { if (titlePane != null) {
container.add(titlePane, BorderLayout.NORTH); container.add(titlePane, BorderLayout.NORTH);
@ -135,14 +135,14 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
this.add(container, BorderLayout.CENTER); this.add(container, BorderLayout.CENTER);
} }
protected JPanel createBackgroundStylePane() { protected JPanel createBackgroundStylePane(boolean supportCornerRadius) {
borderStyleCombo = new UIComboBox(BORDER_STYLE); borderStyleCombo = new UIComboBox(BORDER_STYLE);
borderLineAndImagePane = new BorderLineAndImagePane(this.supportBorderImage); borderLineAndImagePane = new BorderLineAndImagePane(this.supportBorderImage);
cornerSpinner = new UISpinner(0,1000,1,0); cornerSpinner = new UISpinner(0,1000,1,0);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] rowSize = {p, p, p, p}; double[] rowSize = supportCornerRadius ? new double[] {p, p, p, p} : new double[]{p, p, p};
double[] columnSize = {SETTING_LABEL_WIDTH, f}; double[] columnSize = {SETTING_LABEL_WIDTH, f};
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Background_Style")); UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Background_Style"));

Loading…
Cancel
Save