-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
39 lines (31 loc) · 844 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"github.com/samber/lo"
"github.com/yikakia/awf_calc/i18n"
"github.com/yikakia/awf_calc/internal/cfgs"
"github.com/yikakia/awf_calc/view"
"github.com/yikakia/awf_calc/viewmodel"
)
func main() {
a := app.New()
w := a.NewWindow(i18n.MainTitle.T())
w.SetMaster()
bConfs := cfgs.GetBuildingConfigs()
bs := lo.Map(bConfs, func(item *viewmodel.BuildingConfig, index int) *viewmodel.Building {
return viewmodel.NewBuilding(item)
})
table := view.NewMainTable(&view.MainTableDep{
Buildings: bs,
})
total := table.GetTotalTable()
total.Resize(fyne.NewSize(800, 50))
detail := table.GetDetailTableCanVas()
c := container.NewVSplit(total, detail)
c.SetOffset(0.1)
w.SetContent(c)
w.Resize(fyne.NewSize(800, 600))
w.ShowAndRun()
}