app: start building up a layout
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9d29017860
commit
3839735dc8
@ -4,7 +4,10 @@
|
||||
package xkcdreader
|
||||
|
||||
import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/app"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"git.dotya.ml/wanderer/go-xkcdreader/cmd"
|
||||
)
|
||||
@ -16,12 +19,16 @@ func RunApp() {
|
||||
a := app.New()
|
||||
w := a.NewWindow(cmd.GetAppName())
|
||||
|
||||
w.SetContent(makeGreeting())
|
||||
centered := container.New(layout.NewHBoxLayout(), layout.NewSpacer(), makeGreeting(), layout.NewSpacer())
|
||||
w.SetContent(container.New(layout.NewVBoxLayout(), centered))
|
||||
|
||||
w.Resize(fyne.NewSize(400, 400))
|
||||
w.ShowAndRun()
|
||||
}
|
||||
|
||||
// makeGreeting creates a greeting label
|
||||
func makeGreeting() *widget.Label {
|
||||
return widget.NewLabel(appGreeting)
|
||||
w := widget.NewLabel(appGreeting)
|
||||
w.TextStyle.Monospace = true
|
||||
return w
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user