2023-01-03 13:34:32 +01:00
|
|
|
package app
|
2022-11-23 20:33:07 +01:00
|
|
|
|
|
|
|
import (
|
2022-11-24 21:49:10 +01:00
|
|
|
"fyne.io/fyne/v2"
|
2022-11-23 20:33:07 +01:00
|
|
|
"fyne.io/fyne/v2/app"
|
|
|
|
"fyne.io/fyne/v2/container"
|
2023-01-03 13:34:32 +01:00
|
|
|
|
|
|
|
"gitea.mmo.to/ProtocolPacketForger/ppf/internal/ui"
|
2022-11-23 20:33:07 +01:00
|
|
|
)
|
|
|
|
|
2022-11-25 14:35:51 +01:00
|
|
|
var fyneApp fyne.App
|
2023-01-03 15:44:52 +01:00
|
|
|
var w fyne.Window
|
2022-11-25 14:35:51 +01:00
|
|
|
|
2022-11-23 20:33:07 +01:00
|
|
|
func Appmain() {
|
2023-01-03 15:44:52 +01:00
|
|
|
fyneApp = app.New()
|
|
|
|
w = fyneApp.NewWindow("ProtocolPacketForger")
|
2023-01-04 13:38:16 +01:00
|
|
|
w.Resize(fyne.NewSize(1024, 768))
|
2022-11-23 20:33:07 +01:00
|
|
|
|
2022-11-25 14:35:51 +01:00
|
|
|
w.SetContent(CreateApp())
|
2022-11-23 20:33:07 +01:00
|
|
|
|
|
|
|
w.ShowAndRun()
|
|
|
|
}
|
2022-11-25 11:36:29 +01:00
|
|
|
|
|
|
|
func CreateApp() *fyne.Container {
|
2023-01-05 09:06:39 +01:00
|
|
|
ui.PPF.Toolbar = ui.CreateToolbar(fyneApp)
|
|
|
|
ui.PPF.Workarea = ui.CreateWorkarea()
|
|
|
|
ui.PPF.Extensions = container.NewCenter()
|
|
|
|
ui.PPF.ProtocolMeta = ui.CreateMetadataProtocol()
|
|
|
|
ui.PPF.Metadata = &ui.PPF.ProtocolMeta.Metadata
|
|
|
|
ui.PPF.ContextBar = container.NewCenter()
|
2022-11-25 11:36:29 +01:00
|
|
|
|
|
|
|
return container.NewBorder(
|
2023-01-05 09:06:39 +01:00
|
|
|
ui.PPF.Toolbar,
|
|
|
|
ui.PPF.ContextBar,
|
|
|
|
ui.PPF.Metadata.Representation,
|
|
|
|
ui.PPF.Extensions,
|
|
|
|
container.NewVScroll(ui.PPF.Workarea),
|
2022-11-25 11:36:29 +01:00
|
|
|
)
|
|
|
|
}
|