match menu layout on macos
This commit is contained in:
parent
69f0aa8c52
commit
0988794b48
41
src/main.js
41
src/main.js
|
|
@ -1937,6 +1937,11 @@ function addFrame() {
|
||||||
function addKeyframe() {
|
function addKeyframe() {
|
||||||
actions.addKeyframe.create()
|
actions.addKeyframe.create()
|
||||||
}
|
}
|
||||||
|
async function about () {
|
||||||
|
messageDialog(`Lightningbeam version ${await getVersion()}\nDeveloped by Skyler Lehmkuhl`,
|
||||||
|
{title: 'About', kind: "info"}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
async function render() {
|
async function render() {
|
||||||
document.querySelector("body").style.cursor = "wait"
|
document.querySelector("body").style.cursor = "wait"
|
||||||
|
|
@ -2879,6 +2884,28 @@ async function updateMenu() {
|
||||||
} else {
|
} else {
|
||||||
activeFrame = false
|
activeFrame = false
|
||||||
}
|
}
|
||||||
|
if (macOS) {
|
||||||
|
const appSubmenu = await Submenu.new({
|
||||||
|
text: 'Lightningbeam',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: 'About Lightningbeam',
|
||||||
|
enabled: true,
|
||||||
|
action:about
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Settings',
|
||||||
|
enabled: false,
|
||||||
|
action: () => {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Quit Lightningbeam',
|
||||||
|
enabled: true,
|
||||||
|
action: quit,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
const fileSubmenu = await Submenu.new({
|
const fileSubmenu = await Submenu.new({
|
||||||
text: 'File',
|
text: 'File',
|
||||||
items: [
|
items: [
|
||||||
|
|
@ -3032,17 +3059,17 @@ async function updateMenu() {
|
||||||
{
|
{
|
||||||
text: "About...",
|
text: "About...",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
action: async () => {
|
action: about
|
||||||
messageDialog(`Lightningbeam version ${await getVersion()}\nDeveloped by Skyler Lehmkuhl`,
|
|
||||||
{title: 'About', kind: "info"}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let items = [fileSubmenu, editSubmenu, modifySubmenu, timelineSubmenu, viewSubmenu, helpSubmenu]
|
||||||
|
if (macOS) {
|
||||||
|
items.unshift([appSubmenu])
|
||||||
|
}
|
||||||
const menu = await Menu.new({
|
const menu = await Menu.new({
|
||||||
items: [fileSubmenu, editSubmenu, modifySubmenu, timelineSubmenu, viewSubmenu, helpSubmenu],
|
items: items,
|
||||||
})
|
})
|
||||||
await (macOS ? menu.setAsAppMenu() : menu.setAsWindowMenu())
|
await (macOS ? menu.setAsAppMenu() : menu.setAsWindowMenu())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue