Some checks failed
CloudSave/pipeline/head There was a failure building this commit
42 lines
822 B
Go
42 lines
822 B
Go
package sync
|
|
|
|
import (
|
|
"image/color"
|
|
|
|
"fyne.io/fyne/v2"
|
|
"fyne.io/fyne/v2/canvas"
|
|
"fyne.io/fyne/v2/container"
|
|
"fyne.io/fyne/v2/dialog"
|
|
"fyne.io/fyne/v2/layout"
|
|
"fyne.io/fyne/v2/widget"
|
|
)
|
|
|
|
type (
|
|
SyncDialog struct {
|
|
*dialog.CustomDialog
|
|
label *canvas.Text
|
|
pg *widget.ProgressBarInfinite
|
|
}
|
|
)
|
|
|
|
func Make(total int, w fyne.Window) *SyncDialog {
|
|
|
|
title := canvas.NewText("Warming up...", color.Black)
|
|
title.Alignment = fyne.TextAlignCenter
|
|
|
|
pg := widget.NewProgressBarInfinite()
|
|
|
|
c := container.New(layout.NewVBoxLayout(), title, pg)
|
|
d := &SyncDialog{
|
|
CustomDialog: dialog.NewCustomWithoutButtons("Syncing", c, w),
|
|
label: title,
|
|
pg: pg,
|
|
}
|
|
return d
|
|
}
|
|
|
|
func (s *SyncDialog) UpdateLabel(msg string) {
|
|
s.label.Text = msg
|
|
s.label.Refresh()
|
|
}
|