Browse Source

Pull request #15132: REPORT-137646 & REPORT-137829 fix:删除“没有背景” & 移动端弹窗布局调整

Merge in DESIGN/design from ~ZONGYU.WANG/design:fbp/master to fbp/master

* commit '406b9f89b34f9b1395512a45069c49a30cef7769':
  fix:回退 拖拽范围修改
  REPORT-137646 & REPORT-137829 fix:删除“没有背景” & 移动端弹窗布局调整,split panel 设置拖拽范围
fbp/master
Zongyu.Wang-王宗雨 1 month ago
parent
commit
b4316f5c8e
  1. 4
      designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java
  2. 14
      designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java
  3. 40
      designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java
  4. BIN
      designer-chart/src/main/resources/com/fr/design/images/background/null_background.png

4
designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java

@ -45,7 +45,7 @@ public class MobilePopupRegularPane extends BasicPane {
spinnerGroupPane = this.createSpinnerPane(); spinnerGroupPane = this.createSpinnerPane();
this.add(column(LayoutConstants.VERTICAL_GAP, this.add(column(LayoutConstants.VERTICAL_GAP,
cell(this.createRadioButtonGroupPane()), cell(this.createRadioButtonGroupPane()),
row(flex(1), cell(spinnerGroupPane).weight(3)) row(flex(1.5), cell(spinnerGroupPane).weight(3))
).getComponent()); ).getComponent());
} }
@ -62,7 +62,7 @@ public class MobilePopupRegularPane extends BasicPane {
radioButtons.add(autoRadio); radioButtons.add(autoRadio);
radiosPane.add(row(30, cell(customRadio), cell(autoRadio), flex()).getComponent()); radiosPane.add(row(30, cell(customRadio), cell(autoRadio), flex()).getComponent());
return row(cell(new UILabel(this.label, FineUIStyle.LABEL_SECONDARY)).weight(1), cell(radiosPane).weight(3)).getComponent(); return row(cell(new UILabel(this.label, FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(radiosPane).weight(3)).getComponent();
} }
private ActionListener radioActionListener = new ActionListener() { private ActionListener radioActionListener = new ActionListener() {

14
designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java

@ -83,9 +83,9 @@ public class StyleSettingPane extends BasicBeanPane<MobilePopupHyperlink> {
UILabel borderLabel = new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Border")); UILabel borderLabel = new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Border"));
borderPane.add(column(LayoutConstants.VERTICAL_GAP, borderPane.add(column(LayoutConstants.VERTICAL_GAP,
row(cell(borderLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Line"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderType).weight(2), flex(3)), row(cell(borderLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Line"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(borderType).weight(2), flex(2.5)),
row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderColor).weight(2), flex(3)), row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(borderColor).weight(2), flex(2.5)),
row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Radius"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderRadiusSpinner).weight(2), flex(3)) row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Radius"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(borderRadiusSpinner).weight(2), flex(2.5))
).getComponent()); ).getComponent());
return borderPane; return borderPane;
} }
@ -102,8 +102,8 @@ public class StyleSettingPane extends BasicBeanPane<MobilePopupHyperlink> {
JLabel bgLabel = new JLabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Background")); JLabel bgLabel = new JLabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Background"));
bgPane.add(column(LayoutConstants.VERTICAL_GAP, bgPane.add(column(LayoutConstants.VERTICAL_GAP,
row(cell(bgLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(bgColor).weight(2), flex(3)), row(cell(bgLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(bgColor).weight(2), flex(2.5)),
row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Opacity"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(transparencyPane).weight(3), flex(2)) row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Opacity"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(transparencyPane).weight(3), flex(1.5))
).getComponent()); ).getComponent());
return bgPane; return bgPane;
} }
@ -117,9 +117,9 @@ public class StyleSettingPane extends BasicBeanPane<MobilePopupHyperlink> {
sizePane.add(column(LayoutConstants.VERTICAL_GAP, sizePane.add(column(LayoutConstants.VERTICAL_GAP,
row( row(
column(LayoutConstants.VERTICAL_GAP, cell(sizeLabel), flex()).weight(1), column(LayoutConstants.VERTICAL_GAP, cell(sizeLabel), flex()).weight(1),
cell(mobileRegularPane).weight(4), flex(2) cell(mobileRegularPane).weight(4.5), flex(1.5)
), ),
row(flex(1), cell(padRegularPane).weight(4), flex(2)) row(flex(1), cell(padRegularPane).weight(4.5), flex(1.5))
).getComponent()); ).getComponent());
return sizePane; return sizePane;
} }

40
designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java

@ -1,20 +1,15 @@
package com.fr.design.style.background.impl; package com.fr.design.style.background.impl;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundDetailPane; import com.fr.design.style.background.BackgroundDetailPane;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.locale.image.I18nImage;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.column;
@ -25,23 +20,14 @@ import static com.fine.swing.ui.layout.Layouts.flex;
*/ */
public class NullBackgroundPane extends BackgroundDetailPane { public class NullBackgroundPane extends BackgroundDetailPane {
private static final String NULL_BACKGROUND = "/com/fr/design/images/background/null_background.png";
private static final Image DEFAULT_NULL_BACKGROUND_IMAGE;
static {
DEFAULT_NULL_BACKGROUND_IMAGE = I18nImage.getImage(NULL_BACKGROUND);
}
public NullBackgroundPane() { public NullBackgroundPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel centerLabel = new UILabel( UILabel centerLabel = new UILabel(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Background_Is_Null")); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Background_Is_Null"));
ImagePanel imagePane = new ImagePanel();
JPanel pane = column( JPanel pane = column(
10, 10,
flex(), flex(),
cell(imagePane),
cell(centerLabel), cell(centerLabel),
flex() flex()
).getComponent(); ).getComponent();
@ -60,30 +46,4 @@ public class NullBackgroundPane extends BackgroundDetailPane {
public void addChangeListener(ChangeListener changeListener) { public void addChangeListener(ChangeListener changeListener) {
// do nothing. // do nothing.
} }
/**
* 水平居中绘制 Image
*/
public class ImagePanel extends JPanel {
public ImagePanel() {
}
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
if (DEFAULT_NULL_BACKGROUND_IMAGE != null) {
int x = (this.getWidth() - DEFAULT_NULL_BACKGROUND_IMAGE.getWidth(null)) / 2;
g.drawImage(DEFAULT_NULL_BACKGROUND_IMAGE, x, 0, this);
}
}
@Override
public Dimension getPreferredSize() {
if (DEFAULT_NULL_BACKGROUND_IMAGE == null) {
return super.getPreferredSize();
}
return FineUIScale.scale(new Dimension(DEFAULT_NULL_BACKGROUND_IMAGE.getWidth(null), DEFAULT_NULL_BACKGROUND_IMAGE.getHeight(null)));
}
}
} }

BIN
designer-chart/src/main/resources/com/fr/design/images/background/null_background.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

Loading…
Cancel
Save