app: add a basic browse tab UI
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-05-23 17:04:56 +02:00
parent 86f9ea5a28
commit 8c72ee9443
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -65,8 +65,33 @@ func makeToolbar() *widget.Toolbar {
func makeTabs() *container.AppTabs { func makeTabs() *container.AppTabs {
tabs := container.NewAppTabs( tabs := container.NewAppTabs(
container.NewTabItem("xkcd comic", widget.NewLabel("Latest comic...")), container.NewTabItem("xkcd comic", makeBrowseUI()),
container.NewTabItem("what if?", widget.NewLabel("serious answers to absurd questions and absurd advice for common concerns from xkcd's Randall Munroe")), container.NewTabItem("what if?", widget.NewLabel("serious answers to absurd questions and absurd advice for common concerns from xkcd's Randall Munroe")),
) )
return tabs return tabs
} }
func makeBrowseUI() *fyne.Container {
// container for the image and surrounding elements
imgC := container.New(
layout.NewHBoxLayout(),
widget.NewButton("previous", func() {
log.Println("Previous comic")
}),
layout.NewSpacer(),
widget.NewLabel("img placeholder"),
layout.NewSpacer(),
widget.NewButton("next", func() {
log.Println("Next comic")
}))
browseTabLabel := "Latest comic..."
browseUI := container.New(
layout.NewVBoxLayout(),
widget.NewLabel(browseTabLabel),
layout.NewSpacer(),
imgC,
)
return browseUI
}