fix: 改进用户体验
定期执行自动操作保持mini窗口活跃防止长时间无操作后唤醒卡顿; 主窗口隐藏时允许mini窗口出现在Windows切换视图中(取消skipTaskBar标识)以快速切换;
This commit is contained in:
+16
-2
@@ -1,6 +1,5 @@
|
||||
const path = require('path');
|
||||
const { BrowserWindow } = require('electron');
|
||||
const getMenu = require('./menu');
|
||||
const { config } = require('./config');
|
||||
|
||||
function createMainWindow() {
|
||||
@@ -36,4 +35,19 @@ function createMainWindow() {
|
||||
return win;
|
||||
}
|
||||
|
||||
module.exports = createMainWindow;
|
||||
function toggleMainWindowVisibility(window) {
|
||||
if (!window) { return; }
|
||||
if (window.isVisible()) {
|
||||
window.hide();
|
||||
}
|
||||
else {
|
||||
window.show();
|
||||
window.focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
createMainWindow,
|
||||
toggleMainWindowVisibility
|
||||
}
|
||||
Reference in New Issue
Block a user