add local provider, add cover output in textinfo

This commit is contained in:
Aynakeya
2022-07-07 20:30:12 -07:00
parent fd91b1e130
commit 7bf9372898
22 changed files with 301 additions and 76 deletions

View File

@@ -1,11 +1,43 @@
package main
import (
"AynaLivePlayer/plugin/textinfo"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/widget"
"strconv"
"time"
)
func main() {
x := &textinfo.TextInfo{}
x.Enable()
x.RenderTemplates()
var app = app.New()
var (
labelText = ""
bindedLabelText = binding.BindString(&labelText)
label = widget.NewLabelWithData(bindedLabelText)
)
var window = app.NewWindow("Canvas")
var verticalBox = container.NewVBox(label)
window.SetContent(verticalBox)
go func() {
for i := 0; ; i++ {
var newLabelText = strconv.Itoa(i)
if err := bindedLabelText.Set(newLabelText); err != nil {
panic(err)
}
time.Sleep(time.Microsecond)
// NOTE: the only thing, that helps prevent UI updates from freezes, except for the direct manipulation with window size, e.g. update window size from 499x499 -> 500x500 and vice-versa for each iteration
canvas.Refresh(label)
}
}()
window.ShowAndRun()
}