Browse Source

Pull request #8138: REPORT-67348 & REPORT-67303

Merge in DESIGN/design from ~STARRYI/design:feature/x to feature/x

* commit '9531c526b0a67ab4e0f225dfdc135cbe8626615a':
  REPORT-67303 【视觉验收】组件商城面向风格化
  REPORT-67348 组件包下载提示文本中的数量不符合设计意图
feature/x
starryi 3 years ago
parent
commit
1b36033dfe
  1. 15
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java
  2. 39
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java

15
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java

@ -1,15 +1,13 @@
package com.fr.design.mainframe.share.ui.online.mini;
import com.fr.base.ScreenResolution;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.share.mini.MiniShopDisposingChecker;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants;
import com.fr.stable.unit.FU;
import com.fr.stable.unit.UNIT;
import javax.swing.JFrame;
import java.awt.Container;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.Window;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
@ -36,10 +34,11 @@ public class MiniComponentShopDialog {
final JFrame frame = new JFrame();
final MiniComponentShopPane shopPane = new MiniComponentShopPane();
final UNIT width = FU.getInstance(900 * Constants.FU_PER_OLD_PIX);
final UNIT height = FU.getInstance(600 * Constants.FU_PER_OLD_PIX);
int resolution = ScreenResolution.getScreenResolution();
frame.setSize(width.toPixI(resolution), height.toPixI(resolution));
GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();
Rectangle rect =ge.getMaximumWindowBounds();
int width = (int) (rect.width * 0.8);
int height = (int) (rect.height * 0.9);
frame.setSize(width, height);
frame.setTitle(Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Window_Title"));
frame.add(shopPane);
frame.setResizable(false);

39
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java

@ -254,9 +254,9 @@ public class NativeProductBridge {
MiniComponentShopDialog.getInstance().getContentPane(),
Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Incompatible_Component_Tip"),
"",
FineJOptionPane.YES_NO_OPTION
FineJOptionPane.OK_CANCEL_OPTION
);
allowedDownload = result == JOptionPane.YES_OPTION;
allowedDownload = result == JOptionPane.OK_OPTION;
}
if (allowedDownload) {
fireStartEvent(null);
@ -353,33 +353,14 @@ public class NativeProductBridge {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
boolean allowedDownload;
OnlineShareWidget[] childrenWidgets = OnlineShopUtils.getPackageWidgets(widget, false);
boolean isCompatibleWithCurrentEnv = true;
for (OnlineShareWidget children: childrenWidgets) {
if (!children.isCompatibleWithCurrentEnv()) {
isCompatibleWithCurrentEnv = false;
break;
}
}
int result;
if (!isCompatibleWithCurrentEnv) {
result = FineJOptionPane.showConfirmDialog(
MiniComponentShopDialog.getInstance().getContentPane(),
Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Incompatible_Components_Package_Tip", childrenCount),
"",
FineJOptionPane.YES_NO_OPTION
);
} else {
result = FineJOptionPane.showConfirmDialog(
MiniComponentShopDialog.getInstance().getContentPane(),
Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Components_Package_Tip", childrenCount),
"",
FineJOptionPane.YES_NO_OPTION
);
}
allowedDownload = result == JOptionPane.YES_OPTION;
if (allowedDownload) {
OnlineShareWidget[] childrenWidgets = OnlineShopUtils.getPackageWidgets(widget, true);
int result = FineJOptionPane.showConfirmDialog(
MiniComponentShopDialog.getInstance().getContentPane(),
Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Components_Package_Tip", childrenWidgets.length),
"",
FineJOptionPane.OK_CANCEL_OPTION
);
if (result == JOptionPane.OK_OPTION) {
fireStartEvent(null);
action.install();
} else {

Loading…
Cancel
Save