11import { routes } from "@generouted/react-router" ;
2- import { Menu , MenuItem } from "@tauri-apps/api/menu" ;
2+ // import { Menu, MenuItem } from "@tauri-apps/api/menu";
33import { getMatches } from "@tauri-apps/plugin-cli" ;
44import "driver.js/dist/driver.css" ;
55import i18next from "i18next" ;
@@ -37,7 +37,7 @@ import "./index.css";
3737import "./polyfills/roundRect" ;
3838import { exists } from "./utils/fs" ;
3939import { exit , writeStderr } from "./utils/otherApi" ;
40- import { getCurrentWindow , isDesktop , isFrame , isMac , isWeb , isWindows } from "./utils/platform" ;
40+ import { getCurrentWindow , isDesktop , isFrame , isWeb , isWindows } from "./utils/platform" ;
4141
4242/**
4343 * @private
@@ -55,9 +55,6 @@ const el = document.getElementById("root")!;
5555( async ( ) => {
5656 const matches = ! isWeb && isDesktop ? await getMatches ( ) : null ;
5757 const isCliMode = isDesktop && matches ?. args . output ?. occurrences === 1 ;
58- if ( isMac ) {
59- macosLoadMenu ( ) ;
60- }
6158 await Promise . all ( [
6259 Settings . init ( ) ,
6360 RecentFileManager . init ( ) ,
@@ -171,28 +168,31 @@ async function loadStartFile() {
171168}
172169
173170/** macos加载顶部菜单栏 */
174- async function macosLoadMenu ( ) {
175- // 奇怪了,什么都显示不出来(
176- // 创建菜单项
177- const testItem1 = await MenuItem . new ( {
178- text : "测试" ,
179- action : ( _id ) => {
180- console . log ( _id ) ;
181- } ,
182- } ) ;
183- const testItem2 = await MenuItem . new ( {
184- text : "测试2" ,
185- action : ( _id ) => {
186- console . log ( _id ) ;
187- } ,
188- } ) ;
189- // 创建主菜单
190- const menu = await Menu . new ( { items : [ testItem1 , testItem2 ] } ) ;
171+ // tnnd, 屏蔽一些mac的顶部菜单栏本来是打算防止有人误以为软件是英文的
172+ // 结果导致节点进入编辑状态后无法command c/v了。
191173
192- // 设置应用菜单
193- await menu . setAsAppMenu ( ) ;
194- console . log ( "macos加载菜单栏成功" ) ;
195- }
174+ // async function macosLoadMenu() {
175+ // // 奇怪了,什么都显示不出来(
176+ // // 创建菜单项
177+ // const testItem1 = await MenuItem.new({
178+ // text: "测试",
179+ // action: (_id) => {
180+ // console.log(_id);
181+ // },
182+ // });
183+ // const testItem2 = await MenuItem.new({
184+ // text: "测试2",
185+ // action: (_id) => {
186+ // console.log(_id);
187+ // },
188+ // });
189+ // // 创建主菜单
190+ // const menu = await Menu.new({ items: [testItem1, testItem2] });
191+
192+ // // 设置应用菜单
193+ // await menu.setAsAppMenu();
194+ // console.log("macos加载菜单栏成功");
195+ // }
196196
197197/** 渲染应用 */
198198async function renderApp ( cli : boolean = false ) {
0 commit comments