fix: 隐藏窗口菜单栏
This commit is contained in:
+5
-1
@@ -60,7 +60,8 @@ function createMainWindow() {
|
|||||||
title: APP_NAME,
|
title: APP_NAME,
|
||||||
backgroundColor: '#0a0a1a',
|
backgroundColor: '#0a0a1a',
|
||||||
show: false, // 等 ready-to-show 再显示,避免闪烁
|
show: false, // 等 ready-to-show 再显示,避免闪烁
|
||||||
autoHideMenuBar: false,
|
autoHideMenuBar: true,
|
||||||
|
menuBarVisible: false,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload: path.join(__dirname, 'preload.js'),
|
preload: path.join(__dirname, 'preload.js'),
|
||||||
contextIsolation: true,
|
contextIsolation: true,
|
||||||
@@ -75,6 +76,9 @@ function createMainWindow() {
|
|||||||
// 加载应用
|
// 加载应用
|
||||||
mainWindow.loadFile(path.join(__dirname, '..', 'index.html'));
|
mainWindow.loadFile(path.join(__dirname, '..', 'index.html'));
|
||||||
|
|
||||||
|
// 彻底隐藏菜单栏
|
||||||
|
mainWindow.setMenuBarVisibility(false);
|
||||||
|
|
||||||
// 窗口准备好后显示
|
// 窗口准备好后显示
|
||||||
mainWindow.once('ready-to-show', () => {
|
mainWindow.once('ready-to-show', () => {
|
||||||
if (windowState.maximized) {
|
if (windowState.maximized) {
|
||||||
|
|||||||
Reference in New Issue
Block a user