1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-20 22:48:02 +00:00

Moved UI methods to their own struct

This commit is contained in:
2023-02-21 17:47:21 +01:00
parent 5b1f410a50
commit 44c94d0d72
14 changed files with 124 additions and 74 deletions

27
internal/ui/ui.go Normal file
View File

@ -0,0 +1,27 @@
package ui
import (
"context"
"runtime"
"github.com/gen2brain/beeep"
)
type UI struct {
ctx context.Context
}
func New() *UI {
return &UI{}
}
func (u *UI) Startup(ctx context.Context) {
u.ctx = ctx
}
func (u *UI) Beep() {
if runtime.GOOS == "windows" {
return
}
beeep.Beep(beeep.DefaultFreq, beeep.DefaultDuration)
}