go-simple-ui/internal/ui/about_page.go

29 lines
632 B
Go

package ui
import (
"gioui.org/layout"
"gioui.org/widget/material"
)
type AboutPage struct {
theme *material.Theme
}
func NewAboutPage(theme *material.Theme) *AboutPage {
return &AboutPage{
theme: theme,
}
}
func (p *AboutPage) Layout(gtx layout.Context) layout.Dimensions {
return layout.UniformInset(16).Layout(gtx, func(gtx layout.Context) layout.Dimensions {
return layout.Flex{
Axis: layout.Vertical,
}.Layout(gtx,
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
body := material.Body1(p.theme, "This is a simple UI application built with Gio.")
return body.Layout(gtx)
}),
)
})
}