Skip to content

Commit

Permalink
Simplify menubars that are just menus
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhamp committed Jan 2, 2025
1 parent 1fd6d18 commit 7f58f5a
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions resources/js/electron-plugin/src/server/api/menuBar.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import express from "express";
import { Menu, Tray } from "electron";
import { app, Menu, Tray } from "electron";
import { compileMenu } from "./helper/index.js";
import state from "../state.js";
import { menubar } from "menubar";
import { notifyLaravel } from "../utils.js";
import { fileURLToPath } from 'url'

import {enable} from "@electron/remote/main/index.js";
import { enable } from "@electron/remote/main/index.js";

const router = express.Router();

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

tray.setContextMenu(buildMenu(contextMenu));
tray.setToolTip(tooltip);

state.activeMenuBar = menubar({
tray,
tooltip,
index: false,
showDockIcon,
showOnAllWorkspaces: false,
browserWindow: {
show: false,
width: 0,
height: 0,
}
});
if (!showDockIcon) {
app.dock.hide();
}
} else {
state.activeMenuBar = menubar({
icon: icon || state.icon.replace("icon.png", "IconTemplate.png"),
Expand Down

0 comments on commit 7f58f5a

Please sign in to comment.