1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2024-11-22 18:37:41 +01:00
rolens/internal/ui/ui.go

32 lines
473 B
Go
Raw Normal View History

2023-02-21 17:47:21 +01:00
package ui
import (
"context"
"runtime"
"github.com/gen2brain/beeep"
2023-02-21 20:11:40 +01:00
"github.com/ncruces/zenity"
2023-02-21 17:47:21 +01:00
)
type UI struct {
2023-05-26 17:21:39 +02:00
ctx context.Context
progressBars map[uint]zenity.ProgressDialog
2023-02-21 17:47:21 +01:00
}
func New() *UI {
2023-05-26 17:21:39 +02:00
return &UI{
progressBars: make(map[uint]zenity.ProgressDialog),
}
2023-02-21 17:47:21 +01:00
}
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)
}