feat: set application menu
This commit is contained in:
+25
-1
@@ -1,4 +1,4 @@
|
||||
import { app, shell, BrowserWindow } from "electron"
|
||||
import { app, shell, BrowserWindow, Menu } from "electron"
|
||||
import path from "path"
|
||||
import { is } from "@electron-toolkit/utils"
|
||||
import icon from "../../resources/icon.png?asset"
|
||||
@@ -93,6 +93,30 @@ export function createWindow(): void {
|
||||
},
|
||||
)
|
||||
|
||||
Menu.setApplicationMenu(
|
||||
Menu.buildFromTemplate([
|
||||
{
|
||||
role: "appMenu",
|
||||
submenu: [
|
||||
{ role: "about" },
|
||||
{ type: "separator" },
|
||||
{
|
||||
label: "Settings...",
|
||||
accelerator: "CmdOrCtrl+,",
|
||||
click: () => {
|
||||
console.log("Oh, hi there!")
|
||||
},
|
||||
},
|
||||
{ type: "separator" },
|
||||
{ role: "hide" },
|
||||
{ role: "quit" },
|
||||
],
|
||||
},
|
||||
{ role: "viewMenu" },
|
||||
{ role: "windowMenu" },
|
||||
]),
|
||||
)
|
||||
|
||||
app.on("second-instance", (_, commandLine) => {
|
||||
if (mainWindow) {
|
||||
if (mainWindow.isMinimized()) mainWindow.restore()
|
||||
|
||||
@@ -86,7 +86,7 @@ export function FeedColumn({
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm">
|
||||
<Link to={`/follow`} className="flex">
|
||||
<i className="i-mingcute-add-circle-line h-5 w-5 text-zinc-500" />
|
||||
<i className="i-mingcute-add-line h-5 w-5 text-zinc-500" />
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user