Skip to content

Commit 7f58f5a

Browse files
committed
Simplify menubars that are just menus
1 parent 1fd6d18 commit 7f58f5a

File tree

1 file changed

+6
-15
lines changed
  • resources/js/electron-plugin/src/server/api

1 file changed

+6
-15
lines changed

resources/js/electron-plugin/src/server/api/menuBar.ts

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import express from "express";
2-
import { Menu, Tray } from "electron";
2+
import { app, Menu, Tray } from "electron";
33
import { compileMenu } from "./helper/index.js";
44
import state from "../state.js";
55
import { menubar } from "menubar";
66
import { notifyLaravel } from "../utils.js";
77
import { fileURLToPath } from 'url'
8-
9-
import {enable} from "@electron/remote/main/index.js";
8+
import { enable } from "@electron/remote/main/index.js";
109

1110
const router = express.Router();
1211

@@ -88,19 +87,11 @@ router.post("/create", (req, res) => {
8887
const tray = new Tray(icon || state.icon.replace("icon.png", "IconTemplate.png"));
8988

9089
tray.setContextMenu(buildMenu(contextMenu));
90+
tray.setToolTip(tooltip);
9191

92-
state.activeMenuBar = menubar({
93-
tray,
94-
tooltip,
95-
index: false,
96-
showDockIcon,
97-
showOnAllWorkspaces: false,
98-
browserWindow: {
99-
show: false,
100-
width: 0,
101-
height: 0,
102-
}
103-
});
92+
if (!showDockIcon) {
93+
app.dock.hide();
94+
}
10495
} else {
10596
state.activeMenuBar = menubar({
10697
icon: icon || state.icon.replace("icon.png", "IconTemplate.png"),

0 commit comments

Comments
 (0)