From 975b22bc0bdbcd41d90bdcbf4085018afa8abf58 Mon Sep 17 00:00:00 2001 From: WINBIGFOX Date: Sun, 15 Mar 2026 14:25:45 +0100 Subject: [PATCH] Add `minWidth`, `minHeight`, `maxWidth`, and `maxHeight` support to MenuBar options. --- .../electron/electron-plugin/src/server/api/menuBar.ts | 9 ++++++++- src/MenuBar/MenuBar.php | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/resources/electron/electron-plugin/src/server/api/menuBar.ts b/resources/electron/electron-plugin/src/server/api/menuBar.ts index 5c5c7163..4ef80d48 100644 --- a/resources/electron/electron-plugin/src/server/api/menuBar.ts +++ b/resources/electron/electron-plugin/src/server/api/menuBar.ts @@ -4,7 +4,6 @@ import { compileMenu } from "./helper/index.js"; import state from "../state.js"; import { menubar } from "../../libs/menubar/index.js"; import { notifyLaravel } from "../utils.js"; -import { fileURLToPath } from 'url' import { enable } from "@electron/remote/main/index.js"; import mergePreferences from "../webPreferences.js"; @@ -81,6 +80,10 @@ router.post("/create", (req, res) => { const { width, height, + minWidth, + minHeight, + maxWidth, + maxHeight, url, label, alwaysOnTop, @@ -132,6 +135,10 @@ router.post("/create", (req, res) => { browserWindow: { width, height, + minWidth, + minHeight, + maxWidth, + maxHeight, resizable, alwaysOnTop, vibrancy, diff --git a/src/MenuBar/MenuBar.php b/src/MenuBar/MenuBar.php index 2a53e5d0..d1a573d0 100644 --- a/src/MenuBar/MenuBar.php +++ b/src/MenuBar/MenuBar.php @@ -133,6 +133,10 @@ public function toArray(): array 'resizable' => $this->resizable, 'width' => $this->width, 'height' => $this->height, + 'minWidth' => $this->minWidth, + 'minHeight' => $this->minHeight, + 'maxWidth' => $this->maxWidth, + 'maxHeight' => $this->maxHeight, 'vibrancy' => $this->vibrancy, 'showDockIcon' => $this->showDockIcon, 'transparency' => $this->transparent,