50 lines
959 B
Go
50 lines
959 B
Go
package main
|
||
|
||
import (
|
||
"fmt"
|
||
|
||
"fyne.io/fyne/v2"
|
||
"fyne.io/fyne/v2/app"
|
||
"fyne.io/fyne/v2/container"
|
||
"fyne.io/fyne/v2/theme"
|
||
"fyne.io/fyne/v2/widget"
|
||
|
||
"MobileMkch/api"
|
||
"MobileMkch/settings"
|
||
"MobileMkch/ui"
|
||
)
|
||
|
||
func main() {
|
||
a := app.NewWithID("com.mkch.mobile")
|
||
a.SetIcon(theme.ComputerIcon())
|
||
|
||
settings.SetApp(a)
|
||
|
||
MobileOptimizations(a)
|
||
|
||
w := a.NewWindow("MobileMkch")
|
||
w.Resize(fyne.NewSize(400, 700))
|
||
|
||
apiClient := api.NewClient()
|
||
|
||
uiManager := ui.NewUIManager(a, w, apiClient)
|
||
|
||
w.SetContent(uiManager.GetMainContent())
|
||
|
||
w.ShowAndRun()
|
||
}
|
||
|
||
const Version = "1.0.0"
|
||
|
||
func showAbout() *widget.PopUp {
|
||
content := container.NewVBox(
|
||
widget.NewLabel("MobileMkch"),
|
||
widget.NewLabel(fmt.Sprintf("Версия: %s", Version)),
|
||
widget.NewLabel("Мобильный клиент для mkch.pooziqo.xyz"),
|
||
widget.NewLabel(""),
|
||
widget.NewLabel("Разработано с ❤️ на Go + Fyne"),
|
||
)
|
||
|
||
return widget.NewModalPopUp(content, nil)
|
||
}
|