feat: add IDE window and tray menu items
Open IDE (1280x800), API Swagger, separator, Quit. Main window hidden by default, opened via tray menu. Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
1ef9ac8c8d
commit
f7cd7e7f48
1 changed files with 25 additions and 0 deletions
25
main.go
25
main.go
|
|
@ -234,8 +234,33 @@ func main() {
|
|||
})
|
||||
systray.AttachWindow(trayWindow).WindowOffset(5)
|
||||
|
||||
// Main IDE window (hidden initially, opened via tray menu)
|
||||
ideWindow := app.Window.NewWithOptions(application.WebviewWindowOptions{
|
||||
Name: "ide",
|
||||
Title: "Core IDE",
|
||||
Width: 1280,
|
||||
Height: 800,
|
||||
URL: "/",
|
||||
Hidden: true,
|
||||
BackgroundColour: application.NewRGB(26, 27, 38),
|
||||
})
|
||||
|
||||
// Tray menu
|
||||
trayMenu := app.Menu.New()
|
||||
trayMenu.Add("Open IDE").OnClick(func(ctx *application.Context) {
|
||||
ideWindow.Show()
|
||||
ideWindow.Focus()
|
||||
})
|
||||
trayMenu.Add("API Swagger").OnClick(func(ctx *application.Context) {
|
||||
app.Window.NewWithOptions(application.WebviewWindowOptions{
|
||||
Name: "swagger",
|
||||
Title: "Core IDE — API",
|
||||
Width: 1024,
|
||||
Height: 768,
|
||||
URL: "http://localhost" + apiAddr + "/swagger/index.html",
|
||||
})
|
||||
})
|
||||
trayMenu.AddSeparator()
|
||||
trayMenu.Add("Quit").OnClick(func(ctx *application.Context) {
|
||||
app.Quit()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue