Refactor application structure and initialize core components

I decided to rewrite the program taking into account the experience gained.
This commit is contained in:
2025-06-06 14:50:16 +05:00
parent 43d794373a
commit b24155caf6
24 changed files with 1295 additions and 63 deletions

View File

@@ -0,0 +1,39 @@
package view
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/lang"
"fyne.io/fyne/v2/widget"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/internal/application/setting"
)
func StartWithError(err error, languages []setting.Lang, funcSelected func(lang setting.Lang)) fyne.CanvasObject {
messageHead := lang.L("error")
listView := widget.NewList(
func() int {
return len(languages)
},
func() fyne.CanvasObject {
return widget.NewLabel("template")
},
func(i widget.ListItemID, o fyne.CanvasObject) {
block := o.(*widget.Label)
block.SetText(languages[i].Title)
})
listView.OnSelected = func(id widget.ListItemID) {
funcSelected(languages[id])
}
return container.NewBorder(
container.NewVBox(
widget.NewLabel(messageHead),
widget.NewLabel(err.Error()),
),
nil,
nil,
nil,
listView,
)
}