刷新按钮。

This commit is contained in:
tengge1 2020-03-11 20:50:44 +08:00
parent 20a1828347
commit 52ba7fbb7d
2 changed files with 21 additions and 10 deletions

View File

@ -489,7 +489,7 @@
"Luminance": "亮度",
"Time Disk": "时间圆盘",
"Square": "正方形",
"Create Script": "建脚本",
"Create Script": "建脚本",
"Near": "近点",
"Export Geometry JSON File": "导出几何体JSON文件",
"Invert": "颜色反转",
@ -1018,5 +1018,6 @@
"Add Folder": "添加文件夹",
"Input Folder Name": "输入文件夹名称",
"Folder Name": "文件夹名称",
"New folder": "新文件夹"
"New folder": "新文件夹",
"Create Folder": "新建文件夹"
}

View File

@ -16,9 +16,11 @@ class ScriptPanel extends React.Component {
expanded: {}
};
this.handleAddScript = this.handleAddScript.bind(this);
this.handleAddFolder = this.handleAddFolder.bind(this);
this.handleCommitAddFolder = this.handleCommitAddFolder.bind(this);
this.handleAddScript = this.handleAddScript.bind(this);
this.handleRefresh = this.handleRefresh.bind(this);
this.handleSelect = this.handleSelect.bind(this);
this.handleClickIcon = this.handleClickIcon.bind(this);
this.handleExpand = this.handleExpand.bind(this);
@ -62,13 +64,17 @@ class ScriptPanel extends React.Component {
return <div className={'ScriptPanel'}>
<div className={'toolbar'}>
<IconButton icon={'add script'}
title={_t('Create Script')}
onClick={this.handleAddScript}
/>
<IconButton icon={'add-folder'}
title={_t('Add Folder')}
title={_t('Create Folder')}
onClick={this.handleAddFolder}
/>
<IconButton icon={'add script'}
title={_t('Add Script')}
onClick={this.handleAddScript}
<IconButton icon={'refresh'}
title={_t('Refresh')}
onClick={this.handleRefresh}
/>
</div>
<div className={'content'}>
@ -114,6 +120,11 @@ class ScriptPanel extends React.Component {
});
}
handleAddScript() {
const window = app.createElement(ScriptWindow);
app.addElement(window);
}
handleAddFolder() {
app.prompt({
title: _t('Input Folder Name'),
@ -138,9 +149,8 @@ class ScriptPanel extends React.Component {
app.call(`scriptChanged`, this);
}
handleAddScript() {
const window = app.createElement(ScriptWindow);
app.addElement(window);
handleRefresh() {
this.forceUpdate();
}
handleSelect(value) {