-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.go
35 lines (32 loc) · 800 Bytes
/
gui.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//go:build windows
package main
import (
"fmt"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/driver/desktop"
"fyne.io/fyne/v2/widget"
)
func systray() {
a := app.NewWithID("codegoy.obs.overlay")
version = a.Metadata().Version
a.SetIcon(fyne.NewStaticResource("icon", icon))
if desk, ok := a.(desktop.App); ok {
a.SetIcon(fyne.NewStaticResource("icon", icon))
w := a.NewWindow(fmt.Sprintf("OBS-drops-overlay v%s", version))
w.SetFixedSize(true)
m := fyne.NewMenu("links",
fyne.NewMenuItem("Links", func() {
w.Show()
}),
)
desk.SetSystemTrayMenu(m)
w.SetContent(widget.NewRichTextFromMarkdown(fmt.Sprintf(`# Links
* [%s](%s)
* [%s](%s)`, controlLink, controlLink, overlayLink, overlayLink)))
w.SetCloseIntercept(func() {
w.Hide()
})
a.Run()
}
}