mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-13 13:38:16 +08:00
ui界面优化,event handler优化-新增任务池模式,歌词加载优化,新房间管理(可以自动连接) 本地音频搜索算法优化,
This commit is contained in:
@@ -12,11 +12,13 @@ import (
|
||||
func createLyricObj(lyric *model.Lyric) []fyne.CanvasObject {
|
||||
lrcs := make([]fyne.CanvasObject, len(lyric.Lyrics))
|
||||
for i := 0; i < len(lrcs); i++ {
|
||||
l := widget.NewLabelWithStyle(
|
||||
lr := widget.NewLabelWithStyle(
|
||||
lyric.Lyrics[i].Lyric,
|
||||
fyne.TextAlignCenter, fyne.TextStyle{Italic: true})
|
||||
l.Wrapping = fyne.TextWrapWord
|
||||
lrcs[i] = l
|
||||
//lr.Wrapping = fyne.TextWrapWord
|
||||
// todo fix fyne bug
|
||||
lr.Wrapping = fyne.TextWrapBreak
|
||||
lrcs[i] = lr
|
||||
}
|
||||
return lrcs
|
||||
}
|
||||
@@ -41,6 +43,10 @@ func createLyricWindow() fyne.Window {
|
||||
controller.Instance.PlayControl().GetLyric().EventManager().RegisterA(
|
||||
model.EventLyricUpdate, "player.lyric.current_lyric", func(event *event.Event) {
|
||||
e := event.Data.(model.LyricUpdateEvent)
|
||||
if prevIndex >= len(fullLrc.Objects) || e.Lyric.Index >= len(fullLrc.Objects) {
|
||||
// fix race condition
|
||||
return
|
||||
}
|
||||
if e.Lyric == nil {
|
||||
currentLrc.SetText("")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user