feat: add "Always on Top" in window menu.

This commit is contained in:
Kidy Lee
2025-09-28 19:22:03 +08:00
committed by Tienson Qin
parent ba3ff5e5a5
commit be34b7904a

View File

@@ -206,11 +206,19 @@
{:role "editMenu"}
{:role "viewMenu"}
{:role "windowMenu"
:submenu (when-not mac? [{:role "minimize"}
{:role "zoom"}
;; Disable Control+W shortcut
{:role "close"
:accelerator false}])})
:submenu
(concat
(when-not mac?
[{:role "minimize"}
{:role "zoom"}
;; Disable Control+W shortcut
{:role "close"
:accelerator false}])
[{:label "Always on Top"
:type "checkbox"
:click (fn [menuItem browserWindow]
;; switch alwaysOnTop state
(.setAlwaysOnTop browserWindow (.-checked menuItem)))}])})
;; Windows has no about role
template (conj template
(if mac?