fixes
This commit is contained in:
@@ -2,12 +2,19 @@ package main
|
||||
|
||||
import (
|
||||
"cloudsave/pkg/tools/windows"
|
||||
_ "embed"
|
||||
"os"
|
||||
|
||||
"github.com/getlantern/systray"
|
||||
)
|
||||
|
||||
const defaultDocumentRoot string = "C:/ProgramData/CloudSave"
|
||||
const defaultDocumentRoot string = "C:\\ProgramData\\CloudSave"
|
||||
|
||||
//go:embed res/icon.ico
|
||||
var icon []byte
|
||||
|
||||
func main() {
|
||||
go systray.Run(onReady, onExit)
|
||||
run()
|
||||
}
|
||||
|
||||
@@ -15,3 +22,20 @@ func fatal(message string, exitCode int) {
|
||||
windows.MessageBox(windows.NULL, message, "CloudSave", windows.MB_OK)
|
||||
os.Exit(exitCode)
|
||||
}
|
||||
|
||||
func onReady() {
|
||||
systray.SetTitle("CloudSave")
|
||||
systray.SetTooltip("CloudSave")
|
||||
systray.SetIcon(icon)
|
||||
|
||||
mQuit := systray.AddMenuItem("Quit", "Quit")
|
||||
|
||||
go func() {
|
||||
<-mQuit.ClickedCh
|
||||
os.Exit(0)
|
||||
}()
|
||||
}
|
||||
|
||||
func onExit() {
|
||||
// clean up here
|
||||
}
|
||||
|
||||
BIN
cmd/server/res/icon.ico
Normal file
BIN
cmd/server/res/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Reference in New Issue
Block a user