mirror of
https://github.com/HiMeditator/auto-caption.git
synced 2026-02-14 11:34:43 +08:00
feat(engine): 添加字幕窗口宽度记忆功能并优化字幕引擎关闭逻辑
- 添加 captionWindowWidth 属性,用于保存字幕窗口宽度 - 修改 CaptionEngine 中的 stop 和 kill 方法,优化字幕引擎关闭逻辑 - 更新 README,添加预备模型列表
This commit is contained in:
@@ -44,11 +44,14 @@ const defaultControls: Controls = {
|
||||
|
||||
|
||||
class AllConfig {
|
||||
captionWindowWidth: number = 900;
|
||||
|
||||
uiLanguage: UILanguage = 'zh';
|
||||
leftBarWidth: number = 8;
|
||||
uiTheme: UITheme = 'system';
|
||||
styles: Styles = {...defaultStyles};
|
||||
controls: Controls = {...defaultControls};
|
||||
|
||||
lastLogIndex: number = -1;
|
||||
captionLog: CaptionItem[] = [];
|
||||
|
||||
@@ -58,6 +61,7 @@ class AllConfig {
|
||||
const configPath = path.join(app.getPath('userData'), 'config.json')
|
||||
if(fs.existsSync(configPath)){
|
||||
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'))
|
||||
if(config.captionWindowWidth) this.captionWindowWidth = config.captionWindowWidth
|
||||
if(config.uiLanguage) this.uiLanguage = config.uiLanguage
|
||||
if(config.uiTheme) this.uiTheme = config.uiTheme
|
||||
if(config.leftBarWidth) this.leftBarWidth = config.leftBarWidth
|
||||
@@ -69,6 +73,7 @@ class AllConfig {
|
||||
|
||||
public writeConfig() {
|
||||
const config = {
|
||||
captionWindowWidth: this.captionWindowWidth,
|
||||
uiLanguage: this.uiLanguage,
|
||||
uiTheme: this.uiTheme,
|
||||
leftBarWidth: this.leftBarWidth,
|
||||
|
||||
Reference in New Issue
Block a user