This commit is contained in:
@@ -15,7 +15,7 @@ type (
|
||||
SyncDialog struct {
|
||||
*dialog.CustomDialog
|
||||
label *canvas.Text
|
||||
pg *widget.ProgressBar
|
||||
pg *widget.ProgressBarInfinite
|
||||
}
|
||||
)
|
||||
|
||||
@@ -24,8 +24,7 @@ func Make(total int, w fyne.Window) *SyncDialog {
|
||||
title := canvas.NewText("Warming up...", color.Black)
|
||||
title.Alignment = fyne.TextAlignCenter
|
||||
|
||||
pg := widget.NewProgressBar()
|
||||
pg.Max = float64(total)
|
||||
pg := widget.NewProgressBarInfinite()
|
||||
|
||||
c := container.New(layout.NewVBoxLayout(), title, pg)
|
||||
d := &SyncDialog{
|
||||
@@ -38,10 +37,5 @@ func Make(total int, w fyne.Window) *SyncDialog {
|
||||
|
||||
func (s *SyncDialog) UpdateLabel(msg string) {
|
||||
s.label.Text = msg
|
||||
s.Refresh()
|
||||
}
|
||||
|
||||
func (s *SyncDialog) UpdateProgressBar(percentage int) {
|
||||
s.pg.Value = float64(percentage)
|
||||
s.Refresh()
|
||||
s.label.Refresh()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user