chore(core): 调整新建文件时的弹出层样式

This commit is contained in:
王立帮
2025-11-18 01:33:37 +08:00
parent 848cee1b90
commit df1719e5e0
12 changed files with 164 additions and 57 deletions

View File

@@ -60,7 +60,6 @@ ArduShell.killing = false;
ArduShell.progressLayer = new LayerProgress({
width: 200,
cancelValue: Msg.Lang['nav.btn.stop'],
skin: 'layui-anim layui-anim-scale',
cancel: () => {
if (ArduShell.killing) {
return false;

View File

@@ -53,7 +53,6 @@ BU.firmwareLayer = new LayerFirmware({
width: 400,
title: Msg.Lang['nav.btn.burn'],
cancelValue: false,
skin: 'layui-anim layui-anim-scale',
cancel: false,
cancelDisplay: false
});
@@ -72,7 +71,6 @@ BU.killing = false;
BU.progressLayer = new LayerProgress({
width: 200,
cancelValue: Msg.Lang['nav.btn.stop'],
skin: 'layui-anim layui-anim-scale',
cancel: () => {
if (BU.killing) {
return false;

View File

@@ -3,7 +3,7 @@ goog.loadJs('electron', () => {
goog.require('path');
goog.require('Blockly');
goog.require('Mixly.Env');
goog.require('Mixly.LayerExt');
goog.require('Mixly.LayerNewFile');
goog.require('Mixly.Config');
goog.require('Mixly.Title');
goog.require('Mixly.MFile');
@@ -16,7 +16,7 @@ goog.provide('Mixly.Electron.File');
const {
Env,
LayerExt,
LayerNewFile,
Config,
Title,
MFile,
@@ -48,7 +48,22 @@ File.userPath = {
mix: null,
code: null,
hex: null
}
};
File.newFileLayer = new LayerNewFile();
File.newFileLayer.bind('empty', () => {
const mainWorkspace = Workspace.getMain();
const editor = mainWorkspace.getEditorsManager().getActive();
const blockEditor = editor.getPage('block').getEditor();
const codeEditor = editor.getPage('code').getEditor();
const generator = Blockly.generator;
blockEditor.clear();
blockEditor.scrollCenter();
Blockly.hideChaff();
codeEditor.setValue(generator.workspaceToCode(blockEditor) || '', -1);
File.openedFilePath = null;
Title.updateTitle(Title.title);
});
File.showSaveDialog = (title, filters, endFunc) => {
const currentWindow = electron_remote.getCurrentWindow();
@@ -225,28 +240,7 @@ File.new = () => {
return;
}
}
layer.confirm(MSG['confirm_newfile'], {
title: false,
shade: LayerExt.SHADE_ALL,
resize: false,
success: (layero) => {
const { classList } = layero[0].childNodes[1].childNodes[0];
classList.remove('layui-layer-close2');
classList.add('layui-layer-close1');
},
btn: [Msg.Lang['nav.btn.ok'], Msg.Lang['nav.btn.cancel']],
btn2: (index, layero) => {
layer.close(index);
}
}, (index, layero) => {
layer.close(index);
blockEditor.clear();
blockEditor.scrollCenter();
Blockly.hideChaff();
codeEditor.setValue(generator.workspaceToCode(blockEditor) || '', -1);
File.openedFilePath = null;
Title.updateTitle(Title.title);
});
File.newFileLayer.show();
}
File.open = () => {